├── .gitignore ├── DDFeedbackDemo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── DDFeedbackDemo.xcworkspace └── contents.xcworkspacedata ├── DDFeedbackDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── DDFeedbackDemoTests ├── DDFeedbackDemoTests.m └── Info.plist ├── DDSlackFeedback.podspec ├── DDSlackFeedback ├── DDSlackFeedbackManager.h ├── DDSlackFeedbackManager.m ├── UIViewController+DDFeedback.h └── UIViewController+DDFeedback.m ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── AFNetworking │ ├── AFNetworking │ │ ├── AFHTTPRequestOperation.h │ │ ├── AFHTTPRequestOperation.m │ │ ├── AFHTTPRequestOperationManager.h │ │ ├── AFHTTPRequestOperationManager.m │ │ ├── AFHTTPSessionManager.h │ │ ├── AFHTTPSessionManager.m │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworkReachabilityManager.m │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFSecurityPolicy.m │ │ ├── AFURLConnectionOperation.h │ │ ├── AFURLConnectionOperation.m │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLRequestSerialization.m │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLResponseSerialization.m │ │ ├── AFURLSessionManager.h │ │ └── AFURLSessionManager.m │ ├── LICENSE │ ├── README.md │ └── UIKit+AFNetworking │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkActivityIndicatorManager.m │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIActivityIndicatorView+AFNetworking.m │ │ ├── UIAlertView+AFNetworking.h │ │ ├── UIAlertView+AFNetworking.m │ │ ├── UIButton+AFNetworking.h │ │ ├── UIButton+AFNetworking.m │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIImageView+AFNetworking.m │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.m │ │ ├── UIRefreshControl+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.m │ │ ├── UIWebView+AFNetworking.h │ │ └── UIWebView+AFNetworking.m ├── DDPicUploader │ ├── DDPicClient │ │ ├── DDPicClient.h │ │ └── DDPicClient.m │ ├── LICENSE │ └── README.md ├── DDSlackWebhook │ ├── DDSlackWebhook │ │ ├── DDSlackWebHookClient.h │ │ └── DDSlackWebhookClient.m │ ├── LICENSE │ └── README.md ├── Headers │ ├── Private │ │ ├── AFNetworking │ │ │ ├── AFHTTPRequestOperation.h │ │ │ ├── AFHTTPRequestOperationManager.h │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFURLConnectionOperation.h │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLSessionManager.h │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIAlertView+AFNetworking.h │ │ │ ├── UIButton+AFNetworking.h │ │ │ ├── UIImage+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.h │ │ │ ├── UIKit+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ └── UIWebView+AFNetworking.h │ │ ├── DDPicUploader │ │ │ └── DDPicClient.h │ │ └── DDSlackWebhook │ │ │ └── DDSlackWebHookClient.h │ └── Public │ │ ├── AFNetworking │ │ ├── AFHTTPRequestOperation.h │ │ ├── AFHTTPRequestOperationManager.h │ │ ├── AFHTTPSessionManager.h │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFURLConnectionOperation.h │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLSessionManager.h │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIAlertView+AFNetworking.h │ │ ├── UIButton+AFNetworking.h │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.h │ │ └── UIWebView+AFNetworking.h │ │ ├── DDPicUploader │ │ └── DDPicClient.h │ │ └── DDSlackWebhook │ │ └── DDSlackWebHookClient.h ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj └── Target Support Files │ ├── AFNetworking │ ├── AFNetworking-Private.xcconfig │ ├── AFNetworking-dummy.m │ ├── AFNetworking-prefix.pch │ └── AFNetworking.xcconfig │ ├── DDPicUploader │ ├── DDPicUploader-Private.xcconfig │ ├── DDPicUploader-dummy.m │ ├── DDPicUploader-prefix.pch │ └── DDPicUploader.xcconfig │ ├── DDSlackWebhook │ ├── DDSlackWebhook-Private.xcconfig │ ├── DDSlackWebhook-dummy.m │ ├── DDSlackWebhook-prefix.pch │ └── DDSlackWebhook.xcconfig │ └── Pods-DDFeedbackDemo │ ├── Pods-DDFeedbackDemo-acknowledgements.markdown │ ├── Pods-DDFeedbackDemo-acknowledgements.plist │ ├── Pods-DDFeedbackDemo-dummy.m │ ├── Pods-DDFeedbackDemo-resources.sh │ ├── Pods-DDFeedbackDemo.debug.xcconfig │ └── Pods-DDFeedbackDemo.release.xcconfig └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/objective-c 2 | 3 | ### Objective-C ### 4 | # Xcode 5 | # 6 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 7 | 8 | ## Build generated 9 | build/ 10 | DerivedData 11 | 12 | ## Various settings 13 | *.pbxuser 14 | !default.pbxuser 15 | *.mode1v3 16 | !default.mode1v3 17 | *.mode2v3 18 | !default.mode2v3 19 | *.perspectivev3 20 | !default.perspectivev3 21 | xcuserdata 22 | 23 | ## Other 24 | *.xccheckout 25 | *.moved-aside 26 | *.xcuserstate 27 | *.xcscmblueprint 28 | 29 | ## Obj-C/Swift specific 30 | *.hmap 31 | *.ipa 32 | 33 | # CocoaPods 34 | # 35 | # We recommend against adding the Pods directory to your .gitignore. However 36 | # you should judge for yourself, the pros and cons are mentioned at: 37 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 38 | # 39 | #Pods/ 40 | 41 | # Carthage 42 | # 43 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 44 | # Carthage/Checkouts 45 | 46 | Carthage/Build 47 | 48 | ### Objective-C Patch ### 49 | *.xcscmblueprint 50 | -------------------------------------------------------------------------------- /DDFeedbackDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DDFeedbackDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DDFeedbackDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DDFeedbackDemo 4 | // 5 | // Created by im61 on 15/10/11. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DDFeedbackDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DDFeedbackDemo 4 | // 5 | // Created by im61 on 15/10/11. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "DDSlackFeedbackManager.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | [DDSlackFeedbackManager withWebhookURL:[NSURL URLWithString:@""]]; 21 | return YES; 22 | } 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 27 | } 28 | 29 | - (void)applicationDidEnterBackground:(UIApplication *)application { 30 | // 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. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | - (void)applicationWillEnterForeground:(UIApplication *)application { 35 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 36 | } 37 | 38 | - (void)applicationDidBecomeActive:(UIApplication *)application { 39 | // 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. 40 | } 41 | 42 | - (void)applicationWillTerminate:(UIApplication *)application { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DDFeedbackDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /DDFeedbackDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DDFeedbackDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /DDFeedbackDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | NSAppTransportSecurity 47 | 48 | NSExceptionDomains 49 | 50 | picpx.com 51 | 52 | NSIncludesSubdomains 53 | 54 | NSTemporaryExceptionAllowsInsecureHTTPLoads 55 | 56 | NSTemporaryExceptionMinimumTLSVersion 57 | TLSv1.1 58 | 59 | upyun.com 60 | 61 | NSIncludesSubdomains 62 | 63 | NSTemporaryExceptionAllowsInsecureHTTPLoads 64 | 65 | NSTemporaryExceptionMinimumTLSVersion 66 | TLSv1.1 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /DDFeedbackDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DDFeedbackDemo 4 | // 5 | // Created by im61 on 15/10/11. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DDFeedbackDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DDFeedbackDemo 4 | // 5 | // Created by im61 on 15/10/11. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /DDFeedbackDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DDFeedbackDemo 4 | // 5 | // Created by im61 on 15/10/11. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DDFeedbackDemoTests/DDFeedbackDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDFeedbackDemoTests.m 3 | // DDFeedbackDemoTests 4 | // 5 | // Created by im61 on 15/10/11. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DDFeedbackDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DDFeedbackDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DDFeedbackDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /DDSlackFeedback.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint DDSlackFeedback.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "DDSlackFeedback" 19 | s.version = "1.1.2" 20 | s.summary = "DDSlackFeedback allow you send text or screen capture feedback to your slack channel." 21 | 22 | s.description = <<-DESC 23 | DDSlackFeedback help you easily post user text or image feedback to your slack channel, The only the your need 24 | to do is shake your device. 25 | DESC 26 | 27 | s.homepage = "https://github.com/deepdevelop/DDSlackFeedback" 28 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" 29 | 30 | 31 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 32 | # 33 | # Licensing your code is important. See http://choosealicense.com for more info. 34 | # CocoaPods will detect a license file if there is a named LICENSE* 35 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 36 | # 37 | 38 | s.license = "MIT" 39 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" } 40 | 41 | 42 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 43 | # 44 | # Specify the authors of the library, with email addresses. Email addresses 45 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 46 | # accepts just a name if you'd rather not provide an email address. 47 | # 48 | # Specify a social_media_url where others can refer to, for example a twitter 49 | # profile URL. 50 | # 51 | 52 | s.author = { "Liu Yi" => "61upup@gmail.com" } 53 | # Or just: s.author = "Liu Yi" 54 | # s.authors = { "Liu Yi" => "61upup@gmail.com" } 55 | # s.social_media_url = "http://twitter.com/Liu Yi" 56 | 57 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 58 | # 59 | # If this Pod runs only on iOS or OS X, then specify the platform and 60 | # the deployment target. You can optionally include the target after the platform. 61 | # 62 | 63 | s.platform = :ios 64 | s.platform = :ios, "8.0" 65 | 66 | # When using multiple platforms 67 | # s.ios.deployment_target = "7.0" 68 | # s.osx.deployment_target = "10.7" 69 | # s.watchos.deployment_target = "2.0" 70 | 71 | 72 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 73 | # 74 | # Specify the location from where the source should be retrieved. 75 | # Supports git, hg, bzr, svn and HTTP. 76 | # 77 | 78 | s.source = { :git => "https://github.com/deepdevelop/DDSlackFeedback.git", :tag => "1.1.2" } 79 | 80 | 81 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 82 | # 83 | # CocoaPods is smart about how it includes source code. For source files 84 | # giving a folder will include any swift, h, m, mm, c & cpp files. 85 | # For header files it will include any header in the folder. 86 | # Not including the public_header_files will make all headers public. 87 | # 88 | 89 | s.source_files = "DDSlackFeedback/*.{h,m}" 90 | 91 | # s.public_header_files = "Classes/**/*.h" 92 | 93 | 94 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 95 | # 96 | # A list of resources included with the Pod. These are copied into the 97 | # target bundle with a build phase script. Anything else will be cleaned. 98 | # You can preserve files from being cleaned, please don't preserve 99 | # non-essential files like tests, examples and documentation. 100 | # 101 | 102 | # s.resource = "icon.png" 103 | # s.resources = "Resources/*.png" 104 | 105 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 106 | 107 | 108 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 109 | # 110 | # Link your library with frameworks, or libraries. Libraries do not include 111 | # the lib prefix of their name. 112 | # 113 | 114 | # s.framework = "SomeFramework" 115 | # s.frameworks = "SomeFramework", "AnotherFramework" 116 | 117 | # s.library = "iconv" 118 | # s.libraries = "iconv", "xml2" 119 | 120 | 121 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 122 | # 123 | # If your library depends on compiler flags you can set them in the xcconfig hash 124 | # where they will only apply to your library. If you depend on other Podspecs 125 | # you can include multiple dependencies to ensure it works. 126 | 127 | s.requires_arc = true 128 | 129 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 130 | s.dependency "DDPicUploader" 131 | s.dependency "DDSlackWebhook" 132 | end 133 | -------------------------------------------------------------------------------- /DDSlackFeedback/DDSlackFeedbackManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDSlackFeedbackManager.h 3 | // DDFeedbackDemo 4 | // 5 | // Created by im61 on 15/10/12. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DDSlackFeedbackManager : NSObject 12 | 13 | + (instancetype)withWebhookURL:(NSURL *)webhookURL; 14 | + (instancetype)sharedManager; 15 | 16 | - (void)submitFeedback:(NSString *)feedback; 17 | - (void)takeSnapShotForViewController:(UIViewController *)viewController submitFeedback:(NSString *)feedback; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /DDSlackFeedback/DDSlackFeedbackManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDSlackFeedbackManager.m 3 | // DDFeedbackDemo 4 | // 5 | // Created by im61 on 15/10/12. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import "DDPicClient.h" 10 | #import "DDSlackWebHookClient.h" 11 | #import "DDSlackFeedbackManager.h" 12 | 13 | @implementation DDSlackFeedbackManager 14 | 15 | + (instancetype)withWebhookURL:(NSURL *)webhookURL { 16 | DDSlackFeedbackManager *manager = [DDSlackFeedbackManager sharedManager]; 17 | 18 | static dispatch_once_t onceToken; 19 | 20 | dispatch_once(&onceToken, ^{ 21 | [DDSlackWebhookClient withWebhookURL:webhookURL]; 22 | }); 23 | 24 | return manager; 25 | } 26 | 27 | + (instancetype)sharedManager { 28 | static DDSlackFeedbackManager *_sharedManager = nil; 29 | static dispatch_once_t onceToken; 30 | 31 | dispatch_once(&onceToken, ^{ 32 | _sharedManager = [[DDSlackFeedbackManager alloc] init]; 33 | }); 34 | 35 | return _sharedManager; 36 | } 37 | 38 | - (void)submitFeedback:(NSString *)feedback { 39 | [[DDSlackWebhookClient sharedClient] postNotificationToChannel:nil 40 | text:feedback 41 | username:nil 42 | iconURL:nil 43 | iconEmoji:nil 44 | completion:nil]; 45 | } 46 | 47 | - (void)takeSnapShotForViewController:(UIViewController *)viewController submitFeedback:(NSString *)feedback { 48 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 49 | UIImage *snapshot = [self takeSnapShotForViewController:viewController]; 50 | 51 | [[DDPicClient sharedClient] upload:UIImagePNGRepresentation(snapshot) 52 | imageName:@"screencapture.png" 53 | completion:^(NSError *error, NSString *url, NSDictionary *result) { 54 | if (!error) { 55 | NSString *text = [NSString stringWithFormat:@"%@\n%@", url, feedback]; 56 | [[DDSlackWebhookClient sharedClient] postNotificationToChannel:nil 57 | text:text 58 | username:nil 59 | iconURL:nil 60 | iconEmoji:nil 61 | completion:nil]; 62 | } 63 | }]; 64 | }); 65 | } 66 | 67 | - (UIImage *)takeSnapShotForViewController:(UIViewController *)viewController { 68 | CGSize size = viewController.view.window.frame.size; 69 | 70 | UIGraphicsBeginImageContext(size); 71 | 72 | [viewController.view.window drawViewHierarchyInRect:CGRectMake(0, 0, size.width, size.height) afterScreenUpdates:YES]; 73 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 74 | 75 | UIGraphicsEndImageContext(); 76 | 77 | return image; 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /DDSlackFeedback/UIViewController+DDFeedback.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+DDFeedback.h 3 | // DDFeedbackDemo 4 | // 5 | // Created by im61 on 15/10/12. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIViewController (DDFeedback) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DDSlackFeedback/UIViewController+DDFeedback.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+DDShake.m 3 | // DDFeedbackDemo 4 | // 5 | // Created by im61 on 15/10/11. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import "DDPicClient.h" 10 | #import "DDSlackFeedbackManager.h" 11 | #import "UIViewController+DDFeedback.h" 12 | 13 | @implementation UIViewController (DDFeedback) 14 | 15 | - (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event { 16 | if (motion == UIEventSubtypeMotionShake) { 17 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"反馈" 18 | message:nil 19 | preferredStyle:UIAlertControllerStyleAlert]; 20 | 21 | UIAlertAction *captureScreenAction = [UIAlertAction actionWithTitle:@"截屏提交" 22 | style:UIAlertActionStyleDefault 23 | handler:^(UIAlertAction *action) { 24 | UITextField *textField = (UITextField *)alertController.textFields.firstObject; 25 | NSString *feedback = textField.text; 26 | 27 | NSTimeInterval delaySeconds = 1; 28 | 29 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delaySeconds * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 30 | [[DDSlackFeedbackManager sharedManager] takeSnapShotForViewController:self 31 | submitFeedback:feedback]; 32 | }); 33 | }]; 34 | 35 | UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]; 36 | UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"直接提交" 37 | style:UIAlertActionStyleDefault 38 | handler:^(UIAlertAction *action) { 39 | UITextField *textField = (UITextField *)alertController.textFields.firstObject; 40 | NSString *feedback = textField.text; 41 | 42 | [[DDSlackFeedbackManager sharedManager] submitFeedback:feedback]; 43 | }]; 44 | 45 | [alertController addAction:okAction]; 46 | [alertController addAction:captureScreenAction]; 47 | [alertController addAction:cancelAction]; 48 | 49 | [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField){ 50 | textField.placeholder = @"输入需要反馈的问题"; 51 | }]; 52 | 53 | [self presentViewController:alertController animated:YES completion:nil]; 54 | } 55 | } 56 | 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 DeepDevelop-Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, ‘8.0’ 3 | 4 | target 'DDFeedbackDemo' do 5 | 6 | pod 'DDSlackWebhook' 7 | pod 'DDPicUploader' 8 | 9 | 10 | end 11 | 12 | target 'DDFeedbackDemoTests' do 13 | 14 | end 15 | 16 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.6.0): 3 | - AFNetworking/NSURLConnection (= 2.6.0) 4 | - AFNetworking/NSURLSession (= 2.6.0) 5 | - AFNetworking/Reachability (= 2.6.0) 6 | - AFNetworking/Security (= 2.6.0) 7 | - AFNetworking/Serialization (= 2.6.0) 8 | - AFNetworking/UIKit (= 2.6.0) 9 | - AFNetworking/NSURLConnection (2.6.0): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.6.0): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.6.0) 18 | - AFNetworking/Security (2.6.0) 19 | - AFNetworking/Serialization (2.6.0) 20 | - AFNetworking/UIKit (2.6.0): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | - DDPicUploader (1.0): 24 | - AFNetworking (~> 2.5) 25 | - DDSlackWebhook (1.0): 26 | - AFNetworking (~> 2.5) 27 | 28 | DEPENDENCIES: 29 | - DDPicUploader 30 | - DDSlackWebhook 31 | 32 | SPEC CHECKSUMS: 33 | AFNetworking: 79f7eb1a0fcfa7beb409332b2ca49afe9ce53b05 34 | DDPicUploader: 4f31d3ef584c1d7886536f92ce0edaf02be2242a 35 | DDSlackWebhook: 9e41fa2306e35c398c9353698a588289e4bd98cc 36 | 37 | COCOAPODS: 0.38.2 38 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | // AFHTTPRequestOperation.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | #import "AFURLConnectionOperation.h" 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | /** 28 | `AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request. 29 | */ 30 | @interface AFHTTPRequestOperation : AFURLConnectionOperation 31 | 32 | ///------------------------------------------------ 33 | /// @name Getting HTTP URL Connection Information 34 | ///------------------------------------------------ 35 | 36 | /** 37 | The last HTTP response received by the operation's connection. 38 | */ 39 | @property (readonly, nonatomic, strong, nullable) NSHTTPURLResponse *response; 40 | 41 | /** 42 | 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 AFHTTPResponse serializer, which uses the raw data as its response object. The serializer validates the status code to be in the `2XX` range, denoting success. If the response serializer generates an error in `-responseObjectForResponse:data:error:`, the `failure` callback of the session task or request operation will be executed; otherwise, the `success` callback will be executed. 43 | 44 | @warning `responseSerializer` must not be `nil`. Setting a response serializer will clear out any cached value 45 | */ 46 | @property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; 47 | 48 | /** 49 | An object constructed by the `responseSerializer` from the response and response data. Returns `nil` unless the operation `isFinished`, has a `response`, and has `responseData` with non-zero content length. If an error occurs during serialization, `nil` will be returned, and the `error` property will be populated with the serialization error. 50 | */ 51 | @property (readonly, nonatomic, strong, nullable) id responseObject; 52 | 53 | ///----------------------------------------------------------- 54 | /// @name Setting Completion Block Success / Failure Callbacks 55 | ///----------------------------------------------------------- 56 | 57 | /** 58 | Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed. 59 | 60 | This method should be overridden in subclasses in order to specify the response object passed into the success block. 61 | 62 | @param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request. 63 | @param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request. 64 | */ 65 | - (void)setCompletionBlockWithSuccess:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success 66 | failure:(nullable void (^)(AFHTTPRequestOperation *operation, NSError *error))failure; 67 | 68 | @end 69 | 70 | NS_ASSUME_NONNULL_END 71 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m: -------------------------------------------------------------------------------- 1 | // AFHTTPRequestOperation.m 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "AFHTTPRequestOperation.h" 23 | 24 | static dispatch_queue_t http_request_operation_processing_queue() { 25 | static dispatch_queue_t af_http_request_operation_processing_queue; 26 | static dispatch_once_t onceToken; 27 | dispatch_once(&onceToken, ^{ 28 | af_http_request_operation_processing_queue = dispatch_queue_create("com.alamofire.networking.http-request.processing", DISPATCH_QUEUE_CONCURRENT); 29 | }); 30 | 31 | return af_http_request_operation_processing_queue; 32 | } 33 | 34 | static dispatch_group_t http_request_operation_completion_group() { 35 | static dispatch_group_t af_http_request_operation_completion_group; 36 | static dispatch_once_t onceToken; 37 | dispatch_once(&onceToken, ^{ 38 | af_http_request_operation_completion_group = dispatch_group_create(); 39 | }); 40 | 41 | return af_http_request_operation_completion_group; 42 | } 43 | 44 | #pragma mark - 45 | 46 | @interface AFURLConnectionOperation () 47 | @property (readwrite, nonatomic, strong) NSURLRequest *request; 48 | @property (readwrite, nonatomic, strong) NSURLResponse *response; 49 | @end 50 | 51 | @interface AFHTTPRequestOperation () 52 | @property (readwrite, nonatomic, strong) NSHTTPURLResponse *response; 53 | @property (readwrite, nonatomic, strong) id responseObject; 54 | @property (readwrite, nonatomic, strong) NSError *responseSerializationError; 55 | @property (readwrite, nonatomic, strong) NSRecursiveLock *lock; 56 | @end 57 | 58 | @implementation AFHTTPRequestOperation 59 | @dynamic response; 60 | @dynamic lock; 61 | 62 | - (instancetype)initWithRequest:(NSURLRequest *)urlRequest { 63 | self = [super initWithRequest:urlRequest]; 64 | if (!self) { 65 | return nil; 66 | } 67 | 68 | self.responseSerializer = [AFHTTPResponseSerializer serializer]; 69 | 70 | return self; 71 | } 72 | 73 | - (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { 74 | NSParameterAssert(responseSerializer); 75 | 76 | [self.lock lock]; 77 | _responseSerializer = responseSerializer; 78 | self.responseObject = nil; 79 | self.responseSerializationError = nil; 80 | [self.lock unlock]; 81 | } 82 | 83 | - (id)responseObject { 84 | [self.lock lock]; 85 | if (!_responseObject && [self isFinished] && !self.error) { 86 | NSError *error = nil; 87 | self.responseObject = [self.responseSerializer responseObjectForResponse:self.response data:self.responseData error:&error]; 88 | if (error) { 89 | self.responseSerializationError = error; 90 | } 91 | } 92 | [self.lock unlock]; 93 | 94 | return _responseObject; 95 | } 96 | 97 | - (NSError *)error { 98 | if (_responseSerializationError) { 99 | return _responseSerializationError; 100 | } else { 101 | return [super error]; 102 | } 103 | } 104 | 105 | #pragma mark - AFHTTPRequestOperation 106 | 107 | - (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success 108 | failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure 109 | { 110 | // completionBlock is manually nilled out in AFURLConnectionOperation to break the retain cycle. 111 | #pragma clang diagnostic push 112 | #pragma clang diagnostic ignored "-Warc-retain-cycles" 113 | #pragma clang diagnostic ignored "-Wgnu" 114 | self.completionBlock = ^{ 115 | if (self.completionGroup) { 116 | dispatch_group_enter(self.completionGroup); 117 | } 118 | 119 | dispatch_async(http_request_operation_processing_queue(), ^{ 120 | if (self.error) { 121 | if (failure) { 122 | dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{ 123 | failure(self, self.error); 124 | }); 125 | } 126 | } else { 127 | id responseObject = self.responseObject; 128 | if (self.error) { 129 | if (failure) { 130 | dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{ 131 | failure(self, self.error); 132 | }); 133 | } 134 | } else { 135 | if (success) { 136 | dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{ 137 | success(self, responseObject); 138 | }); 139 | } 140 | } 141 | } 142 | 143 | if (self.completionGroup) { 144 | dispatch_group_leave(self.completionGroup); 145 | } 146 | }); 147 | }; 148 | #pragma clang diagnostic pop 149 | } 150 | 151 | #pragma mark - AFURLRequestOperation 152 | 153 | - (void)pause { 154 | [super pause]; 155 | 156 | u_int64_t offset = 0; 157 | if ([self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey]) { 158 | offset = [(NSNumber *)[self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey] unsignedLongLongValue]; 159 | } else { 160 | offset = [(NSData *)[self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey] length]; 161 | } 162 | 163 | NSMutableURLRequest *mutableURLRequest = [self.request mutableCopy]; 164 | if ([self.response respondsToSelector:@selector(allHeaderFields)] && [[self.response allHeaderFields] valueForKey:@"ETag"]) { 165 | [mutableURLRequest setValue:[[self.response allHeaderFields] valueForKey:@"ETag"] forHTTPHeaderField:@"If-Range"]; 166 | } 167 | [mutableURLRequest setValue:[NSString stringWithFormat:@"bytes=%llu-", offset] forHTTPHeaderField:@"Range"]; 168 | self.request = mutableURLRequest; 169 | } 170 | 171 | #pragma mark - NSSecureCoding 172 | 173 | + (BOOL)supportsSecureCoding { 174 | return YES; 175 | } 176 | 177 | - (id)initWithCoder:(NSCoder *)decoder { 178 | self = [super initWithCoder:decoder]; 179 | if (!self) { 180 | return nil; 181 | } 182 | 183 | self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))]; 184 | 185 | return self; 186 | } 187 | 188 | - (void)encodeWithCoder:(NSCoder *)coder { 189 | [super encodeWithCoder:coder]; 190 | 191 | [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))]; 192 | } 193 | 194 | #pragma mark - NSCopying 195 | 196 | - (id)copyWithZone:(NSZone *)zone { 197 | AFHTTPRequestOperation *operation = [super copyWithZone:zone]; 198 | 199 | operation.responseSerializer = [self.responseSerializer copyWithZone:zone]; 200 | operation.completionQueue = self.completionQueue; 201 | operation.completionGroup = self.completionGroup; 202 | 203 | return operation; 204 | } 205 | 206 | @end 207 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | // AFNetworkReachabilityManager.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #if !TARGET_OS_WATCH 25 | #import 26 | 27 | #ifndef NS_DESIGNATED_INITIALIZER 28 | #if __has_attribute(objc_designated_initializer) 29 | #define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 30 | #else 31 | #define NS_DESIGNATED_INITIALIZER 32 | #endif 33 | #endif 34 | 35 | typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) { 36 | AFNetworkReachabilityStatusUnknown = -1, 37 | AFNetworkReachabilityStatusNotReachable = 0, 38 | AFNetworkReachabilityStatusReachableViaWWAN = 1, 39 | AFNetworkReachabilityStatusReachableViaWiFi = 2, 40 | }; 41 | 42 | NS_ASSUME_NONNULL_BEGIN 43 | 44 | /** 45 | `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces. 46 | 47 | 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. 48 | 49 | See Apple's Reachability Sample Code (https://developer.apple.com/library/ios/samplecode/reachability/) 50 | 51 | @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined. 52 | */ 53 | @interface AFNetworkReachabilityManager : NSObject 54 | 55 | /** 56 | The current network reachability status. 57 | */ 58 | @property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus; 59 | 60 | /** 61 | Whether or not the network is currently reachable. 62 | */ 63 | @property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable; 64 | 65 | /** 66 | Whether or not the network is currently reachable via WWAN. 67 | */ 68 | @property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN; 69 | 70 | /** 71 | Whether or not the network is currently reachable via WiFi. 72 | */ 73 | @property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi; 74 | 75 | ///--------------------- 76 | /// @name Initialization 77 | ///--------------------- 78 | 79 | /** 80 | Returns the shared network reachability manager. 81 | */ 82 | + (instancetype)sharedManager; 83 | 84 | /** 85 | Creates and returns a network reachability manager for the specified domain. 86 | 87 | @param domain The domain used to evaluate network reachability. 88 | 89 | @return An initialized network reachability manager, actively monitoring the specified domain. 90 | */ 91 | + (instancetype)managerForDomain:(NSString *)domain; 92 | 93 | /** 94 | Creates and returns a network reachability manager for the socket address. 95 | 96 | @param address The socket address (`sockaddr_in`) used to evaluate network reachability. 97 | 98 | @return An initialized network reachability manager, actively monitoring the specified socket address. 99 | */ 100 | + (instancetype)managerForAddress:(const void *)address; 101 | 102 | /** 103 | Initializes an instance of a network reachability manager from the specified reachability object. 104 | 105 | @param reachability The reachability object to monitor. 106 | 107 | @return An initialized network reachability manager, actively monitoring the specified reachability. 108 | */ 109 | - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER; 110 | 111 | ///-------------------------------------------------- 112 | /// @name Starting & Stopping Reachability Monitoring 113 | ///-------------------------------------------------- 114 | 115 | /** 116 | Starts monitoring for changes in network reachability status. 117 | */ 118 | - (void)startMonitoring; 119 | 120 | /** 121 | Stops monitoring for changes in network reachability status. 122 | */ 123 | - (void)stopMonitoring; 124 | 125 | ///------------------------------------------------- 126 | /// @name Getting Localized Reachability Description 127 | ///------------------------------------------------- 128 | 129 | /** 130 | Returns a localized string representation of the current network reachability status. 131 | */ 132 | - (NSString *)localizedNetworkReachabilityStatusString; 133 | 134 | ///--------------------------------------------------- 135 | /// @name Setting Network Reachability Change Callback 136 | ///--------------------------------------------------- 137 | 138 | /** 139 | Sets a callback to be executed when the network availability of the `baseURL` host changes. 140 | 141 | @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`. 142 | */ 143 | - (void)setReachabilityStatusChangeBlock:(nullable void (^)(AFNetworkReachabilityStatus status))block; 144 | 145 | @end 146 | 147 | ///---------------- 148 | /// @name Constants 149 | ///---------------- 150 | 151 | /** 152 | ## Network Reachability 153 | 154 | The following constants are provided by `AFNetworkReachabilityManager` as possible network reachability statuses. 155 | 156 | enum { 157 | AFNetworkReachabilityStatusUnknown, 158 | AFNetworkReachabilityStatusNotReachable, 159 | AFNetworkReachabilityStatusReachableViaWWAN, 160 | AFNetworkReachabilityStatusReachableViaWiFi, 161 | } 162 | 163 | `AFNetworkReachabilityStatusUnknown` 164 | The `baseURL` host reachability is not known. 165 | 166 | `AFNetworkReachabilityStatusNotReachable` 167 | The `baseURL` host cannot be reached. 168 | 169 | `AFNetworkReachabilityStatusReachableViaWWAN` 170 | The `baseURL` host can be reached via a cellular connection, such as EDGE or GPRS. 171 | 172 | `AFNetworkReachabilityStatusReachableViaWiFi` 173 | The `baseURL` host can be reached via a Wi-Fi connection. 174 | 175 | ### Keys for Notification UserInfo Dictionary 176 | 177 | Strings that are used as keys in a `userInfo` dictionary in a network reachability status change notification. 178 | 179 | `AFNetworkingReachabilityNotificationStatusItem` 180 | A key in the userInfo dictionary in a `AFNetworkingReachabilityDidChangeNotification` notification. 181 | The corresponding value is an `NSNumber` object representing the `AFNetworkReachabilityStatus` value for the current reachability status. 182 | */ 183 | 184 | ///-------------------- 185 | /// @name Notifications 186 | ///-------------------- 187 | 188 | /** 189 | Posted when network reachability changes. 190 | 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. 191 | 192 | @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`). 193 | */ 194 | extern NSString * const AFNetworkingReachabilityDidChangeNotification; 195 | extern NSString * const AFNetworkingReachabilityNotificationStatusItem; 196 | 197 | ///-------------------- 198 | /// @name Functions 199 | ///-------------------- 200 | 201 | /** 202 | Returns a localized string representation of an `AFNetworkReachabilityStatus` value. 203 | */ 204 | extern NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status); 205 | 206 | NS_ASSUME_NONNULL_END 207 | #endif 208 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | #import 25 | 26 | #ifndef _AFNETWORKING_ 27 | #define _AFNETWORKING_ 28 | 29 | #import "AFURLRequestSerialization.h" 30 | #import "AFURLResponseSerialization.h" 31 | #import "AFSecurityPolicy.h" 32 | #if !TARGET_OS_WATCH 33 | #import "AFNetworkReachabilityManager.h" 34 | #import "AFURLConnectionOperation.h" 35 | #import "AFHTTPRequestOperation.h" 36 | #import "AFHTTPRequestOperationManager.h" 37 | #endif 38 | 39 | #if ( ( defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || \ 40 | ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 ) || \ 41 | TARGET_OS_WATCH ) 42 | #import "AFURLSessionManager.h" 43 | #import "AFHTTPSessionManager.h" 44 | #endif 45 | 46 | #endif /* _AFNETWORKING_ */ 47 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | // AFSecurityPolicy.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | #import 24 | 25 | typedef NS_ENUM(NSUInteger, AFSSLPinningMode) { 26 | AFSSLPinningModeNone, 27 | AFSSLPinningModePublicKey, 28 | AFSSLPinningModeCertificate, 29 | }; 30 | 31 | /** 32 | `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. 33 | 34 | 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. 35 | */ 36 | 37 | NS_ASSUME_NONNULL_BEGIN 38 | 39 | @interface AFSecurityPolicy : NSObject 40 | 41 | /** 42 | The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. 43 | */ 44 | @property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; 45 | 46 | /** 47 | 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 app bundle. Note that if you create an array with duplicate certificates, the duplicate certificates will be removed. Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. 48 | */ 49 | @property (nonatomic, strong, nullable) NSArray *pinnedCertificates; 50 | 51 | /** 52 | Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. 53 | */ 54 | @property (nonatomic, assign) BOOL allowInvalidCertificates; 55 | 56 | /** 57 | Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`. 58 | */ 59 | @property (nonatomic, assign) BOOL validatesDomainName; 60 | 61 | ///----------------------------------------- 62 | /// @name Getting Specific Security Policies 63 | ///----------------------------------------- 64 | 65 | /** 66 | 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. 67 | 68 | @return The default security policy. 69 | */ 70 | + (instancetype)defaultPolicy; 71 | 72 | ///--------------------- 73 | /// @name Initialization 74 | ///--------------------- 75 | 76 | /** 77 | Creates and returns a security policy with the specified pinning mode. 78 | 79 | @param pinningMode The SSL pinning mode. 80 | 81 | @return A new security policy. 82 | */ 83 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; 84 | 85 | ///------------------------------ 86 | /// @name Evaluating Server Trust 87 | ///------------------------------ 88 | 89 | /** 90 | Whether or not the specified server trust should be accepted, based on the security policy. 91 | 92 | This method should be used when responding to an authentication challenge from a server. 93 | 94 | @param serverTrust The X.509 certificate trust of the server. 95 | 96 | @return Whether or not to trust the server. 97 | 98 | @warning This method has been deprecated in favor of `-evaluateServerTrust:forDomain:`. 99 | */ 100 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust DEPRECATED_ATTRIBUTE; 101 | 102 | /** 103 | Whether or not the specified server trust should be accepted, based on the security policy. 104 | 105 | This method should be used when responding to an authentication challenge from a server. 106 | 107 | @param serverTrust The X.509 certificate trust of the server. 108 | @param domain The domain of serverTrust. If `nil`, the domain will not be validated. 109 | 110 | @return Whether or not to trust the server. 111 | */ 112 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust 113 | forDomain:(nullable NSString *)domain; 114 | 115 | @end 116 | 117 | NS_ASSUME_NONNULL_END 118 | 119 | ///---------------- 120 | /// @name Constants 121 | ///---------------- 122 | 123 | /** 124 | ## SSL Pinning Modes 125 | 126 | The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes. 127 | 128 | enum { 129 | AFSSLPinningModeNone, 130 | AFSSLPinningModePublicKey, 131 | AFSSLPinningModeCertificate, 132 | } 133 | 134 | `AFSSLPinningModeNone` 135 | Do not used pinned certificates to validate servers. 136 | 137 | `AFSSLPinningModePublicKey` 138 | Validate host certificates against public keys of pinned certificates. 139 | 140 | `AFSSLPinningModeCertificate` 141 | Validate host certificates against pinned certificates. 142 | */ 143 | -------------------------------------------------------------------------------- /Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | // AFNetworkActivityIndicatorManager.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | /** 33 | `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a network request operation 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. 34 | 35 | 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: 36 | 37 | [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; 38 | 39 | 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. 40 | 41 | See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: 42 | http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 43 | */ 44 | NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") 45 | @interface AFNetworkActivityIndicatorManager : NSObject 46 | 47 | /** 48 | A Boolean value indicating whether the manager is enabled. 49 | 50 | If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. 51 | */ 52 | @property (nonatomic, assign, getter = isEnabled) BOOL enabled; 53 | 54 | /** 55 | A Boolean value indicating whether the network activity indicator is currently displayed in the status bar. 56 | */ 57 | @property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible; 58 | 59 | /** 60 | Returns the shared network activity indicator manager object for the system. 61 | 62 | @return The systemwide network activity indicator manager. 63 | */ 64 | + (instancetype)sharedManager; 65 | 66 | /** 67 | Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. 68 | */ 69 | - (void)incrementActivityCount; 70 | 71 | /** 72 | Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. 73 | */ 74 | - (void)decrementActivityCount; 75 | 76 | @end 77 | 78 | NS_ASSUME_NONNULL_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m: -------------------------------------------------------------------------------- 1 | // AFNetworkActivityIndicatorManager.m 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "AFNetworkActivityIndicatorManager.h" 23 | 24 | #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) 25 | 26 | #import "AFHTTPRequestOperation.h" 27 | 28 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 29 | #import "AFURLSessionManager.h" 30 | #endif 31 | 32 | static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.17; 33 | 34 | static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) { 35 | if ([[notification object] isKindOfClass:[AFURLConnectionOperation class]]) { 36 | return [(AFURLConnectionOperation *)[notification object] request]; 37 | } 38 | 39 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 40 | if ([[notification object] respondsToSelector:@selector(originalRequest)]) { 41 | return [(NSURLSessionTask *)[notification object] originalRequest]; 42 | } 43 | #endif 44 | 45 | return nil; 46 | } 47 | 48 | @interface AFNetworkActivityIndicatorManager () 49 | @property (readwrite, nonatomic, assign) NSInteger activityCount; 50 | @property (readwrite, nonatomic, strong) NSTimer *activityIndicatorVisibilityTimer; 51 | @property (readonly, nonatomic, getter = isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; 52 | 53 | - (void)updateNetworkActivityIndicatorVisibility; 54 | - (void)updateNetworkActivityIndicatorVisibilityDelayed; 55 | @end 56 | 57 | @implementation AFNetworkActivityIndicatorManager 58 | @dynamic networkActivityIndicatorVisible; 59 | 60 | + (instancetype)sharedManager { 61 | static AFNetworkActivityIndicatorManager *_sharedManager = nil; 62 | static dispatch_once_t oncePredicate; 63 | dispatch_once(&oncePredicate, ^{ 64 | _sharedManager = [[self alloc] init]; 65 | }); 66 | 67 | return _sharedManager; 68 | } 69 | 70 | + (NSSet *)keyPathsForValuesAffectingIsNetworkActivityIndicatorVisible { 71 | return [NSSet setWithObject:@"activityCount"]; 72 | } 73 | 74 | - (id)init { 75 | self = [super init]; 76 | if (!self) { 77 | return nil; 78 | } 79 | 80 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingOperationDidStartNotification object:nil]; 81 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingOperationDidFinishNotification object:nil]; 82 | 83 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 84 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingTaskDidResumeNotification object:nil]; 85 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidSuspendNotification object:nil]; 86 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidCompleteNotification object:nil]; 87 | #endif 88 | 89 | return self; 90 | } 91 | 92 | - (void)dealloc { 93 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 94 | 95 | [_activityIndicatorVisibilityTimer invalidate]; 96 | } 97 | 98 | - (void)updateNetworkActivityIndicatorVisibilityDelayed { 99 | if (self.enabled) { 100 | // Delay hiding of activity indicator for a short interval, to avoid flickering 101 | if (![self isNetworkActivityIndicatorVisible]) { 102 | [self.activityIndicatorVisibilityTimer invalidate]; 103 | self.activityIndicatorVisibilityTimer = [NSTimer timerWithTimeInterval:kAFNetworkActivityIndicatorInvisibilityDelay target:self selector:@selector(updateNetworkActivityIndicatorVisibility) userInfo:nil repeats:NO]; 104 | [[NSRunLoop mainRunLoop] addTimer:self.activityIndicatorVisibilityTimer forMode:NSRunLoopCommonModes]; 105 | } else { 106 | [self performSelectorOnMainThread:@selector(updateNetworkActivityIndicatorVisibility) withObject:nil waitUntilDone:NO modes:@[NSRunLoopCommonModes]]; 107 | } 108 | } 109 | } 110 | 111 | - (BOOL)isNetworkActivityIndicatorVisible { 112 | return self.activityCount > 0; 113 | } 114 | 115 | - (void)updateNetworkActivityIndicatorVisibility { 116 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:[self isNetworkActivityIndicatorVisible]]; 117 | } 118 | 119 | - (void)setActivityCount:(NSInteger)activityCount { 120 | @synchronized(self) { 121 | _activityCount = activityCount; 122 | } 123 | 124 | dispatch_async(dispatch_get_main_queue(), ^{ 125 | [self updateNetworkActivityIndicatorVisibilityDelayed]; 126 | }); 127 | } 128 | 129 | - (void)incrementActivityCount { 130 | [self willChangeValueForKey:@"activityCount"]; 131 | @synchronized(self) { 132 | _activityCount++; 133 | } 134 | [self didChangeValueForKey:@"activityCount"]; 135 | 136 | dispatch_async(dispatch_get_main_queue(), ^{ 137 | [self updateNetworkActivityIndicatorVisibilityDelayed]; 138 | }); 139 | } 140 | 141 | - (void)decrementActivityCount { 142 | [self willChangeValueForKey:@"activityCount"]; 143 | @synchronized(self) { 144 | #pragma clang diagnostic push 145 | #pragma clang diagnostic ignored "-Wgnu" 146 | _activityCount = MAX(_activityCount - 1, 0); 147 | #pragma clang diagnostic pop 148 | } 149 | [self didChangeValueForKey:@"activityCount"]; 150 | 151 | dispatch_async(dispatch_get_main_queue(), ^{ 152 | [self updateNetworkActivityIndicatorVisibilityDelayed]; 153 | }); 154 | } 155 | 156 | - (void)networkRequestDidStart:(NSNotification *)notification { 157 | if ([AFNetworkRequestFromNotification(notification) URL]) { 158 | [self incrementActivityCount]; 159 | } 160 | } 161 | 162 | - (void)networkRequestDidFinish:(NSNotification *)notification { 163 | if ([AFNetworkRequestFromNotification(notification) URL]) { 164 | [self decrementActivityCount]; 165 | } 166 | } 167 | 168 | @end 169 | 170 | #endif 171 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | @class AFURLConnectionOperation; 31 | 32 | /** 33 | 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 request operation or session task. 34 | */ 35 | @interface UIActivityIndicatorView (AFNetworking) 36 | 37 | ///---------------------------------- 38 | /// @name Animating for Session Tasks 39 | ///---------------------------------- 40 | 41 | /** 42 | Binds the animating state to the state of the specified task. 43 | 44 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 45 | */ 46 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 47 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 48 | #endif 49 | 50 | ///--------------------------------------- 51 | /// @name Animating for Request Operations 52 | ///--------------------------------------- 53 | 54 | /** 55 | Binds the animating state to the execution state of the specified operation. 56 | 57 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 58 | */ 59 | - (void)setAnimatingWithStateOfOperation:(nullable AFURLConnectionOperation *)operation; 60 | 61 | @end 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.m 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIActivityIndicatorView+AFNetworking.h" 23 | #import 24 | 25 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 26 | 27 | #import "AFHTTPRequestOperation.h" 28 | 29 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 30 | #import "AFURLSessionManager.h" 31 | #endif 32 | 33 | @interface AFActivityIndicatorViewNotificationObserver : NSObject 34 | @property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView; 35 | - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView; 36 | 37 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 38 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task; 39 | #endif 40 | - (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation; 41 | 42 | @end 43 | 44 | @implementation UIActivityIndicatorView (AFNetworking) 45 | 46 | - (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver { 47 | AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); 48 | if (notificationObserver == nil) { 49 | notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self]; 50 | objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 51 | } 52 | return notificationObserver; 53 | } 54 | 55 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 56 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { 57 | [[self af_notificationObserver] setAnimatingWithStateOfTask:task]; 58 | } 59 | #endif 60 | 61 | - (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation { 62 | [[self af_notificationObserver] setAnimatingWithStateOfOperation:operation]; 63 | } 64 | 65 | @end 66 | 67 | @implementation AFActivityIndicatorViewNotificationObserver 68 | 69 | - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView 70 | { 71 | self = [super init]; 72 | if (self) { 73 | _activityIndicatorView = activityIndicatorView; 74 | } 75 | return self; 76 | } 77 | 78 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 79 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { 80 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 81 | 82 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 83 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 84 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 85 | 86 | if (task) { 87 | if (task.state != NSURLSessionTaskStateCompleted) { 88 | 89 | #pragma clang diagnostic push 90 | #pragma clang diagnostic ignored "-Wreceiver-is-weak" 91 | #pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" 92 | if (task.state == NSURLSessionTaskStateRunning) { 93 | [self.activityIndicatorView startAnimating]; 94 | } else { 95 | [self.activityIndicatorView stopAnimating]; 96 | } 97 | #pragma clang diagnostic pop 98 | 99 | [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task]; 100 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task]; 101 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task]; 102 | } 103 | } 104 | } 105 | #endif 106 | 107 | #pragma mark - 108 | 109 | - (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation { 110 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 111 | 112 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil]; 113 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil]; 114 | 115 | if (operation) { 116 | if (![operation isFinished]) { 117 | 118 | #pragma clang diagnostic push 119 | #pragma clang diagnostic ignored "-Wreceiver-is-weak" 120 | #pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" 121 | if ([operation isExecuting]) { 122 | [self.activityIndicatorView startAnimating]; 123 | } else { 124 | [self.activityIndicatorView stopAnimating]; 125 | } 126 | #pragma clang diagnostic pop 127 | 128 | [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingOperationDidStartNotification object:operation]; 129 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingOperationDidFinishNotification object:operation]; 130 | } 131 | } 132 | } 133 | 134 | #pragma mark - 135 | 136 | - (void)af_startAnimating { 137 | dispatch_async(dispatch_get_main_queue(), ^{ 138 | #pragma clang diagnostic push 139 | #pragma clang diagnostic ignored "-Wreceiver-is-weak" 140 | [self.activityIndicatorView startAnimating]; 141 | #pragma clang diagnostic pop 142 | }); 143 | } 144 | 145 | - (void)af_stopAnimating { 146 | dispatch_async(dispatch_get_main_queue(), ^{ 147 | #pragma clang diagnostic push 148 | #pragma clang diagnostic ignored "-Wreceiver-is-weak" 149 | [self.activityIndicatorView stopAnimating]; 150 | #pragma clang diagnostic pop 151 | }); 152 | } 153 | 154 | #pragma mark - 155 | 156 | - (void)dealloc { 157 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 158 | 159 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 160 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 161 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 162 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 163 | #endif 164 | 165 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil]; 166 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil]; 167 | } 168 | 169 | @end 170 | 171 | #endif 172 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIAlertView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFURLConnectionOperation; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIAlertView` class. The methods in this category provide support for automatically showing an alert if a session task or request operation finishes with an error. Alert title and message are filled from the corresponding `localizedDescription` & `localizedRecoverySuggestion` or `localizedFailureReason` of the error. 36 | */ 37 | @interface UIAlertView (AFNetworking) 38 | 39 | ///------------------------------------- 40 | /// @name Showing Alert for Session Task 41 | ///------------------------------------- 42 | 43 | /** 44 | Shows an alert view with the error of the specified session task, if any. 45 | 46 | @param task The session task. 47 | @param delegate The alert view delegate. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | + (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task 51 | delegate:(nullable id)delegate NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); 52 | #endif 53 | 54 | /** 55 | Shows an alert view with the error of the specified session task, if any, with a custom cancel button title and other button titles. 56 | 57 | @param task The session task. 58 | @param delegate The alert view delegate. 59 | @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title. 60 | @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`. 61 | */ 62 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 63 | + (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task 64 | delegate:(nullable id)delegate 65 | cancelButtonTitle:(nullable NSString *)cancelButtonTitle 66 | otherButtonTitles:(nullable NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); 67 | #endif 68 | 69 | ///------------------------------------------ 70 | /// @name Showing Alert for Request Operation 71 | ///------------------------------------------ 72 | 73 | /** 74 | Shows an alert view with the error of the specified request operation, if any. 75 | 76 | @param operation The request operation. 77 | @param delegate The alert view delegate. 78 | */ 79 | + (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation 80 | delegate:(nullable id)delegate NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); 81 | 82 | /** 83 | Shows an alert view with the error of the specified request operation, if any, with a custom cancel button title and other button titles. 84 | 85 | @param operation The request operation. 86 | @param delegate The alert view delegate. 87 | @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title. 88 | @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`. 89 | */ 90 | + (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation 91 | delegate:(nullable id)delegate 92 | cancelButtonTitle:(nullable NSString *)cancelButtonTitle 93 | otherButtonTitles:(nullable NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); 94 | 95 | @end 96 | 97 | NS_ASSUME_NONNULL_END 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIAlertView+AFNetworking.m 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIAlertView+AFNetworking.h" 23 | 24 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 25 | 26 | #import "AFURLConnectionOperation.h" 27 | 28 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 29 | #import "AFURLSessionManager.h" 30 | #endif 31 | 32 | static void AFGetAlertViewTitleAndMessageFromError(NSError *error, NSString * __autoreleasing *title, NSString * __autoreleasing *message) { 33 | if (error.localizedDescription && (error.localizedRecoverySuggestion || error.localizedFailureReason)) { 34 | *title = error.localizedDescription; 35 | 36 | if (error.localizedRecoverySuggestion) { 37 | *message = error.localizedRecoverySuggestion; 38 | } else { 39 | *message = error.localizedFailureReason; 40 | } 41 | } else if (error.localizedDescription) { 42 | *title = NSLocalizedStringFromTable(@"Error", @"AFNetworking", @"Fallback Error Description"); 43 | *message = error.localizedDescription; 44 | } else { 45 | *title = NSLocalizedStringFromTable(@"Error", @"AFNetworking", @"Fallback Error Description"); 46 | *message = [NSString stringWithFormat:NSLocalizedStringFromTable(@"%@ Error: %ld", @"AFNetworking", @"Fallback Error Failure Reason Format"), error.domain, (long)error.code]; 47 | } 48 | } 49 | 50 | @implementation UIAlertView (AFNetworking) 51 | 52 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 53 | + (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task 54 | delegate:(id)delegate 55 | { 56 | [self showAlertViewForTaskWithErrorOnCompletion:task delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"AFNetworking", @"UIAlertView Cancel Button Title") otherButtonTitles:nil, nil]; 57 | } 58 | 59 | + (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task 60 | delegate:(id)delegate 61 | cancelButtonTitle:(NSString *)cancelButtonTitle 62 | otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION 63 | { 64 | NSMutableArray *mutableOtherTitles = [NSMutableArray array]; 65 | va_list otherButtonTitleList; 66 | va_start(otherButtonTitleList, otherButtonTitles); 67 | { 68 | for (NSString *otherButtonTitle = otherButtonTitles; otherButtonTitle != nil; otherButtonTitle = va_arg(otherButtonTitleList, NSString *)) { 69 | [mutableOtherTitles addObject:otherButtonTitle]; 70 | } 71 | } 72 | va_end(otherButtonTitleList); 73 | 74 | __block __weak id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingTaskDidCompleteNotification object:task queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { 75 | NSError *error = notification.userInfo[AFNetworkingTaskDidCompleteErrorKey]; 76 | if (error) { 77 | NSString *title, *message; 78 | AFGetAlertViewTitleAndMessageFromError(error, &title, &message); 79 | 80 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil, nil]; 81 | for (NSString *otherButtonTitle in mutableOtherTitles) { 82 | [alertView addButtonWithTitle:otherButtonTitle]; 83 | } 84 | [alertView setTitle:title]; 85 | [alertView setMessage:message]; 86 | [alertView show]; 87 | } 88 | 89 | [[NSNotificationCenter defaultCenter] removeObserver:observer]; 90 | }]; 91 | } 92 | #endif 93 | 94 | #pragma mark - 95 | 96 | + (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation 97 | delegate:(id)delegate 98 | { 99 | [self showAlertViewForRequestOperationWithErrorOnCompletion:operation delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"AFNetworking", @"UIAlertView Cancel Button Title") otherButtonTitles:nil, nil]; 100 | } 101 | 102 | + (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation 103 | delegate:(id)delegate 104 | cancelButtonTitle:(NSString *)cancelButtonTitle 105 | otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION 106 | { 107 | NSMutableArray *mutableOtherTitles = [NSMutableArray array]; 108 | va_list otherButtonTitleList; 109 | va_start(otherButtonTitleList, otherButtonTitles); 110 | { 111 | for (NSString *otherButtonTitle = otherButtonTitles; otherButtonTitle != nil; otherButtonTitle = va_arg(otherButtonTitleList, NSString *)) { 112 | [mutableOtherTitles addObject:otherButtonTitle]; 113 | } 114 | } 115 | va_end(otherButtonTitleList); 116 | 117 | __block __weak id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidFinishNotification object:operation queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { 118 | 119 | if (notification.object && [notification.object isKindOfClass:[AFURLConnectionOperation class]]) { 120 | NSError *error = [(AFURLConnectionOperation *)notification.object error]; 121 | if (error) { 122 | NSString *title, *message; 123 | AFGetAlertViewTitleAndMessageFromError(error, &title, &message); 124 | 125 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil, nil]; 126 | for (NSString *otherButtonTitle in mutableOtherTitles) { 127 | [alertView addButtonWithTitle:otherButtonTitle]; 128 | } 129 | [alertView setTitle:title]; 130 | [alertView setMessage:message]; 131 | [alertView show]; 132 | } 133 | } 134 | 135 | [[NSNotificationCenter defaultCenter] removeObserver:observer]; 136 | }]; 137 | } 138 | 139 | @end 140 | 141 | #endif 142 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIButton+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @protocol AFURLResponseSerialization, AFImageCache; 33 | 34 | /** 35 | 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. 36 | 37 | @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported. 38 | */ 39 | @interface UIButton (AFNetworking) 40 | 41 | ///---------------------------- 42 | /// @name Accessing Image Cache 43 | ///---------------------------- 44 | 45 | /** 46 | The image cache used to improve image loading performance on scroll views. By default, `UIButton` will use the `sharedImageCache` of `UIImageView`. 47 | */ 48 | + (id )sharedImageCache; 49 | 50 | /** 51 | Set the cache used for image loading. 52 | 53 | @param imageCache The image cache. 54 | */ 55 | + (void)setSharedImageCache:(id )imageCache; 56 | 57 | ///------------------------------------ 58 | /// @name Accessing Response Serializer 59 | ///------------------------------------ 60 | 61 | /** 62 | The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`. 63 | 64 | @discussion Subclasses of `AFImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/AFNetworking/AFCoreImageSerializer 65 | */ 66 | @property (nonatomic, strong) id imageResponseSerializer; 67 | 68 | ///-------------------- 69 | /// @name Setting Image 70 | ///-------------------- 71 | 72 | /** 73 | 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. 74 | 75 | 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. 76 | 77 | @param state The control state. 78 | @param url The URL used for the image request. 79 | */ 80 | - (void)setImageForState:(UIControlState)state 81 | withURL:(NSURL *)url; 82 | 83 | /** 84 | 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. 85 | 86 | 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. 87 | 88 | @param state The control state. 89 | @param url The URL used for the image request. 90 | @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. 91 | */ 92 | - (void)setImageForState:(UIControlState)state 93 | withURL:(NSURL *)url 94 | placeholderImage:(nullable UIImage *)placeholderImage; 95 | 96 | /** 97 | 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. 98 | 99 | 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. 100 | 101 | 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. 102 | 103 | @param state The control state. 104 | @param urlRequest The URL request used for the image request. 105 | @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. 106 | @param success A block to be executed when the image request operation finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the request and response parameters will be `nil`. 107 | @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes a single argument: the error that occurred. 108 | */ 109 | - (void)setImageForState:(UIControlState)state 110 | withURLRequest:(NSURLRequest *)urlRequest 111 | placeholderImage:(nullable UIImage *)placeholderImage 112 | success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success 113 | failure:(nullable void (^)(NSError *error))failure; 114 | 115 | 116 | ///------------------------------- 117 | /// @name Setting Background Image 118 | ///------------------------------- 119 | 120 | /** 121 | 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. 122 | 123 | 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. 124 | 125 | @param state The control state. 126 | @param url The URL used for the background image request. 127 | */ 128 | - (void)setBackgroundImageForState:(UIControlState)state 129 | withURL:(NSURL *)url; 130 | 131 | /** 132 | 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. 133 | 134 | 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. 135 | 136 | @param state The control state. 137 | @param url The URL used for the background image request. 138 | @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. 139 | */ 140 | - (void)setBackgroundImageForState:(UIControlState)state 141 | withURL:(NSURL *)url 142 | placeholderImage:(nullable UIImage *)placeholderImage; 143 | 144 | /** 145 | 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. 146 | 147 | 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. 148 | 149 | 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. 150 | 151 | @param state The control state. 152 | @param urlRequest The URL request used for the image request. 153 | @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. 154 | */ 155 | - (void)setBackgroundImageForState:(UIControlState)state 156 | withURLRequest:(NSURLRequest *)urlRequest 157 | placeholderImage:(nullable UIImage *)placeholderImage 158 | success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success 159 | failure:(nullable void (^)(NSError *error))failure; 160 | 161 | 162 | ///------------------------------ 163 | /// @name Canceling Image Loading 164 | ///------------------------------ 165 | 166 | /** 167 | Cancels any executing image operation for the specified control state of the receiver, if one exists. 168 | 169 | @param state The control state. 170 | */ 171 | - (void)cancelImageRequestOperationForState:(UIControlState)state; 172 | 173 | /** 174 | Cancels any executing background image operation for the specified control state of the receiver, if one exists. 175 | 176 | @param state The control state. 177 | */ 178 | - (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state; 179 | 180 | @end 181 | 182 | NS_ASSUME_NONNULL_END 183 | 184 | #endif 185 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AFNetworking.h 3 | // 4 | // 5 | // Created by Paulo Ferreira on 08/07/15. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIImageView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @protocol AFURLResponseSerialization, AFImageCache; 33 | 34 | /** 35 | 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. 36 | */ 37 | @interface UIImageView (AFNetworking) 38 | 39 | ///---------------------------- 40 | /// @name Accessing Image Cache 41 | ///---------------------------- 42 | 43 | /** 44 | The image cache used to improve image loading performance on scroll views. By default, this is an `NSCache` subclass conforming to the `AFImageCache` protocol, which listens for notification warnings and evicts objects accordingly. 45 | */ 46 | + (id )sharedImageCache; 47 | 48 | /** 49 | Set the cache used for image loading. 50 | 51 | @param imageCache The image cache. 52 | */ 53 | + (void)setSharedImageCache:(id )imageCache; 54 | 55 | ///------------------------------------ 56 | /// @name Accessing Response Serializer 57 | ///------------------------------------ 58 | 59 | /** 60 | The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`. 61 | 62 | @discussion Subclasses of `AFImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/AFNetworking/AFCoreImageSerializer 63 | */ 64 | @property (nonatomic, strong) id imageResponseSerializer; 65 | 66 | ///-------------------- 67 | /// @name Setting Image 68 | ///-------------------- 69 | 70 | /** 71 | 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. 72 | 73 | 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. 74 | 75 | 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:` 76 | 77 | @param url The URL used for the image request. 78 | */ 79 | - (void)setImageWithURL:(NSURL *)url; 80 | 81 | /** 82 | 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. 83 | 84 | 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. 85 | 86 | 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:` 87 | 88 | @param url The URL used for the image request. 89 | @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. 90 | */ 91 | - (void)setImageWithURL:(NSURL *)url 92 | placeholderImage:(nullable UIImage *)placeholderImage; 93 | 94 | /** 95 | 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. 96 | 97 | 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. 98 | 99 | 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. 100 | 101 | @param urlRequest The URL request used for the image request. 102 | @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. 103 | @param success A block to be executed when the image request operation 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`. 104 | @param failure A block object to be executed when the image request operation 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. 105 | */ 106 | - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest 107 | placeholderImage:(nullable UIImage *)placeholderImage 108 | success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success 109 | failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure; 110 | 111 | /** 112 | Cancels any executing image operation for the receiver, if one exists. 113 | */ 114 | - (void)cancelImageRequestOperation; 115 | 116 | @end 117 | 118 | #pragma mark - 119 | 120 | /** 121 | The `AFImageCache` protocol is adopted by an object used to cache images loaded by the AFNetworking category on `UIImageView`. 122 | */ 123 | @protocol AFImageCache 124 | 125 | /** 126 | Returns a cached image for the specified request, if available. 127 | 128 | @param request The image request. 129 | 130 | @return The cached image. 131 | */ 132 | - (nullable UIImage *)cachedImageForRequest:(NSURLRequest *)request; 133 | 134 | /** 135 | Caches a particular image for the specified request. 136 | 137 | @param image The image to cache. 138 | @param request The request to be used as a cache key. 139 | */ 140 | - (void)cacheImage:(UIImage *)image 141 | forRequest:(NSURLRequest *)request; 142 | @end 143 | 144 | NS_ASSUME_NONNULL_END 145 | 146 | #endif 147 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIImageView+AFNetworking.m 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIImageView+AFNetworking.h" 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import "AFHTTPRequestOperation.h" 29 | 30 | @interface AFImageCache : NSCache 31 | @end 32 | 33 | #pragma mark - 34 | 35 | @interface UIImageView (_AFNetworking) 36 | @property (readwrite, nonatomic, strong, setter = af_setImageRequestOperation:) AFHTTPRequestOperation *af_imageRequestOperation; 37 | @end 38 | 39 | @implementation UIImageView (_AFNetworking) 40 | 41 | + (NSOperationQueue *)af_sharedImageRequestOperationQueue { 42 | static NSOperationQueue *_af_sharedImageRequestOperationQueue = nil; 43 | static dispatch_once_t onceToken; 44 | dispatch_once(&onceToken, ^{ 45 | _af_sharedImageRequestOperationQueue = [[NSOperationQueue alloc] init]; 46 | _af_sharedImageRequestOperationQueue.maxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount; 47 | }); 48 | 49 | return _af_sharedImageRequestOperationQueue; 50 | } 51 | 52 | - (AFHTTPRequestOperation *)af_imageRequestOperation { 53 | return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_imageRequestOperation)); 54 | } 55 | 56 | - (void)af_setImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation { 57 | objc_setAssociatedObject(self, @selector(af_imageRequestOperation), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 58 | } 59 | 60 | @end 61 | 62 | #pragma mark - 63 | 64 | @implementation UIImageView (AFNetworking) 65 | @dynamic imageResponseSerializer; 66 | 67 | + (id )sharedImageCache { 68 | static AFImageCache *_af_defaultImageCache = nil; 69 | static dispatch_once_t oncePredicate; 70 | dispatch_once(&oncePredicate, ^{ 71 | _af_defaultImageCache = [[AFImageCache alloc] init]; 72 | 73 | [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidReceiveMemoryWarningNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * __unused notification) { 74 | [_af_defaultImageCache removeAllObjects]; 75 | }]; 76 | }); 77 | 78 | #pragma clang diagnostic push 79 | #pragma clang diagnostic ignored "-Wgnu" 80 | return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: _af_defaultImageCache; 81 | #pragma clang diagnostic pop 82 | } 83 | 84 | + (void)setSharedImageCache:(id )imageCache { 85 | objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 86 | } 87 | 88 | #pragma mark - 89 | 90 | - (id )imageResponseSerializer { 91 | static id _af_defaultImageResponseSerializer = nil; 92 | static dispatch_once_t onceToken; 93 | dispatch_once(&onceToken, ^{ 94 | _af_defaultImageResponseSerializer = [AFImageResponseSerializer serializer]; 95 | }); 96 | 97 | #pragma clang diagnostic push 98 | #pragma clang diagnostic ignored "-Wgnu" 99 | return objc_getAssociatedObject(self, @selector(imageResponseSerializer)) ?: _af_defaultImageResponseSerializer; 100 | #pragma clang diagnostic pop 101 | } 102 | 103 | - (void)setImageResponseSerializer:(id )serializer { 104 | objc_setAssociatedObject(self, @selector(imageResponseSerializer), serializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 105 | } 106 | 107 | #pragma mark - 108 | 109 | - (void)setImageWithURL:(NSURL *)url { 110 | [self setImageWithURL:url placeholderImage:nil]; 111 | } 112 | 113 | - (void)setImageWithURL:(NSURL *)url 114 | placeholderImage:(UIImage *)placeholderImage 115 | { 116 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; 117 | [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; 118 | 119 | [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; 120 | } 121 | 122 | - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest 123 | placeholderImage:(UIImage *)placeholderImage 124 | success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success 125 | failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure 126 | { 127 | [self cancelImageRequestOperation]; 128 | 129 | UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest]; 130 | if (cachedImage) { 131 | if (success) { 132 | success(urlRequest, nil, cachedImage); 133 | } else { 134 | self.image = cachedImage; 135 | } 136 | 137 | self.af_imageRequestOperation = nil; 138 | } else { 139 | if (placeholderImage) { 140 | self.image = placeholderImage; 141 | } 142 | 143 | __weak __typeof(self)weakSelf = self; 144 | self.af_imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest]; 145 | self.af_imageRequestOperation.responseSerializer = self.imageResponseSerializer; 146 | [self.af_imageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { 147 | __strong __typeof(weakSelf)strongSelf = weakSelf; 148 | if ([[urlRequest URL] isEqual:[strongSelf.af_imageRequestOperation.request URL]]) { 149 | if (success) { 150 | success(urlRequest, operation.response, responseObject); 151 | } else if (responseObject) { 152 | strongSelf.image = responseObject; 153 | } 154 | 155 | if (operation == strongSelf.af_imageRequestOperation){ 156 | strongSelf.af_imageRequestOperation = nil; 157 | } 158 | } 159 | 160 | [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest]; 161 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 162 | __strong __typeof(weakSelf)strongSelf = weakSelf; 163 | if ([[urlRequest URL] isEqual:[strongSelf.af_imageRequestOperation.request URL]]) { 164 | if (failure) { 165 | failure(urlRequest, operation.response, error); 166 | } 167 | 168 | if (operation == strongSelf.af_imageRequestOperation){ 169 | strongSelf.af_imageRequestOperation = nil; 170 | } 171 | } 172 | }]; 173 | 174 | [[[self class] af_sharedImageRequestOperationQueue] addOperation:self.af_imageRequestOperation]; 175 | } 176 | } 177 | 178 | - (void)cancelImageRequestOperation { 179 | [self.af_imageRequestOperation cancel]; 180 | self.af_imageRequestOperation = nil; 181 | } 182 | 183 | @end 184 | 185 | #pragma mark - 186 | 187 | static inline NSString * AFImageCacheKeyFromURLRequest(NSURLRequest *request) { 188 | return [[request URL] absoluteString]; 189 | } 190 | 191 | @implementation AFImageCache 192 | 193 | - (UIImage *)cachedImageForRequest:(NSURLRequest *)request { 194 | switch ([request cachePolicy]) { 195 | case NSURLRequestReloadIgnoringCacheData: 196 | case NSURLRequestReloadIgnoringLocalAndRemoteCacheData: 197 | return nil; 198 | default: 199 | break; 200 | } 201 | 202 | return [self objectForKey:AFImageCacheKeyFromURLRequest(request)]; 203 | } 204 | 205 | - (void)cacheImage:(UIImage *)image 206 | forRequest:(NSURLRequest *)request 207 | { 208 | if (image && request) { 209 | [self setObject:image forKey:AFImageCacheKeyFromURLRequest(request)]; 210 | } 211 | } 212 | 213 | @end 214 | 215 | #endif 216 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #if TARGET_OS_IOS 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #import "AFNetworkActivityIndicatorManager.h" 30 | 31 | #import "UIActivityIndicatorView+AFNetworking.h" 32 | #import "UIAlertView+AFNetworking.h" 33 | #import "UIButton+AFNetworking.h" 34 | #import "UIImageView+AFNetworking.h" 35 | #import "UIProgressView+AFNetworking.h" 36 | #import "UIRefreshControl+AFNetworking.h" 37 | #import "UIWebView+AFNetworking.h" 38 | #endif /* _UIKIT_AFNETWORKING_ */ 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFURLConnectionOperation; 33 | 34 | /** 35 | 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 or request operation. 36 | */ 37 | @interface UIProgressView (AFNetworking) 38 | 39 | ///------------------------------------ 40 | /// @name Setting Session Task Progress 41 | ///------------------------------------ 42 | 43 | /** 44 | Binds the progress to the upload progress of the specified session task. 45 | 46 | @param task The session task. 47 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 51 | animated:(BOOL)animated; 52 | #endif 53 | 54 | /** 55 | Binds the progress to the download progress of the specified session task. 56 | 57 | @param task The session task. 58 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 59 | */ 60 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 61 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 62 | animated:(BOOL)animated; 63 | #endif 64 | 65 | ///------------------------------------ 66 | /// @name Setting Session Task Progress 67 | ///------------------------------------ 68 | 69 | /** 70 | Binds the progress to the upload progress of the specified request operation. 71 | 72 | @param operation The request operation. 73 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 74 | */ 75 | - (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation 76 | animated:(BOOL)animated; 77 | 78 | /** 79 | Binds the progress to the download progress of the specified request operation. 80 | 81 | @param operation The request operation. 82 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 83 | */ 84 | - (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation 85 | animated:(BOOL)animated; 86 | 87 | @end 88 | 89 | NS_ASSUME_NONNULL_END 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.m 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIProgressView+AFNetworking.h" 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import "AFURLConnectionOperation.h" 29 | 30 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 31 | #import "AFURLSessionManager.h" 32 | #endif 33 | 34 | static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext; 35 | static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext; 36 | 37 | @interface AFURLConnectionOperation (_UIProgressView) 38 | @property (readwrite, nonatomic, copy) void (^uploadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected); 39 | @property (readwrite, nonatomic, assign, setter = af_setUploadProgressAnimated:) BOOL af_uploadProgressAnimated; 40 | 41 | @property (readwrite, nonatomic, copy) void (^downloadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected); 42 | @property (readwrite, nonatomic, assign, setter = af_setDownloadProgressAnimated:) BOOL af_downloadProgressAnimated; 43 | @end 44 | 45 | @implementation AFURLConnectionOperation (_UIProgressView) 46 | @dynamic uploadProgress; // Implemented in AFURLConnectionOperation 47 | @dynamic af_uploadProgressAnimated; 48 | 49 | @dynamic downloadProgress; // Implemented in AFURLConnectionOperation 50 | @dynamic af_downloadProgressAnimated; 51 | @end 52 | 53 | #pragma mark - 54 | 55 | @implementation UIProgressView (AFNetworking) 56 | 57 | - (BOOL)af_uploadProgressAnimated { 58 | return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue]; 59 | } 60 | 61 | - (void)af_setUploadProgressAnimated:(BOOL)animated { 62 | objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 63 | } 64 | 65 | - (BOOL)af_downloadProgressAnimated { 66 | return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue]; 67 | } 68 | 69 | - (void)af_setDownloadProgressAnimated:(BOOL)animated { 70 | objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 71 | } 72 | 73 | #pragma mark - 74 | 75 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 76 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 77 | animated:(BOOL)animated 78 | { 79 | [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; 80 | [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; 81 | 82 | [self af_setUploadProgressAnimated:animated]; 83 | } 84 | 85 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 86 | animated:(BOOL)animated 87 | { 88 | [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; 89 | [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; 90 | 91 | [self af_setDownloadProgressAnimated:animated]; 92 | } 93 | #endif 94 | 95 | #pragma mark - 96 | 97 | - (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation 98 | animated:(BOOL)animated 99 | { 100 | __weak __typeof(self)weakSelf = self; 101 | void (^original)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) = [operation.uploadProgress copy]; 102 | [operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) { 103 | if (original) { 104 | original(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite); 105 | } 106 | 107 | dispatch_async(dispatch_get_main_queue(), ^{ 108 | if (totalBytesExpectedToWrite > 0) { 109 | __strong __typeof(weakSelf)strongSelf = weakSelf; 110 | [strongSelf setProgress:(totalBytesWritten / (totalBytesExpectedToWrite * 1.0f)) animated:animated]; 111 | } 112 | }); 113 | }]; 114 | } 115 | 116 | - (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation 117 | animated:(BOOL)animated 118 | { 119 | __weak __typeof(self)weakSelf = self; 120 | void (^original)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) = [operation.downloadProgress copy]; 121 | [operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) { 122 | if (original) { 123 | original(bytesRead, totalBytesRead, totalBytesExpectedToRead); 124 | } 125 | 126 | dispatch_async(dispatch_get_main_queue(), ^{ 127 | if (totalBytesExpectedToRead > 0) { 128 | __strong __typeof(weakSelf)strongSelf = weakSelf; 129 | [strongSelf setProgress:(totalBytesRead / (totalBytesExpectedToRead * 1.0f)) animated:animated]; 130 | } 131 | }); 132 | }]; 133 | } 134 | 135 | #pragma mark - NSKeyValueObserving 136 | 137 | - (void)observeValueForKeyPath:(NSString *)keyPath 138 | ofObject:(id)object 139 | change:(__unused NSDictionary *)change 140 | context:(void *)context 141 | { 142 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 143 | if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) { 144 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { 145 | if ([object countOfBytesExpectedToSend] > 0) { 146 | dispatch_async(dispatch_get_main_queue(), ^{ 147 | [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated]; 148 | }); 149 | } 150 | } 151 | 152 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) { 153 | if ([object countOfBytesExpectedToReceive] > 0) { 154 | dispatch_async(dispatch_get_main_queue(), ^{ 155 | [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated]; 156 | }); 157 | } 158 | } 159 | 160 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) { 161 | if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) { 162 | @try { 163 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))]; 164 | 165 | if (context == AFTaskCountOfBytesSentContext) { 166 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))]; 167 | } 168 | 169 | if (context == AFTaskCountOfBytesReceivedContext) { 170 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))]; 171 | } 172 | } 173 | @catch (NSException * __unused exception) {} 174 | } 175 | } 176 | } 177 | #endif 178 | } 179 | 180 | @end 181 | 182 | #endif 183 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2014 AFNetworking (http://afnetworking.com) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | #import 26 | 27 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 28 | 29 | #import 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | @class AFURLConnectionOperation; 34 | 35 | /** 36 | 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 request operation or session task. 37 | */ 38 | @interface UIRefreshControl (AFNetworking) 39 | 40 | ///----------------------------------- 41 | /// @name Refreshing for Session Tasks 42 | ///----------------------------------- 43 | 44 | /** 45 | Binds the refreshing state to the state of the specified task. 46 | 47 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 51 | #endif 52 | 53 | ///---------------------------------------- 54 | /// @name Refreshing for Request Operations 55 | ///---------------------------------------- 56 | 57 | /** 58 | Binds the refreshing state to the execution state of the specified operation. 59 | 60 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 61 | */ 62 | - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation; 63 | 64 | @end 65 | 66 | NS_ASSUME_NONNULL_END 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2014 AFNetworking (http://afnetworking.com) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import "UIRefreshControl+AFNetworking.h" 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import "AFHTTPRequestOperation.h" 29 | 30 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 31 | #import "AFURLSessionManager.h" 32 | #endif 33 | 34 | @interface AFRefreshControlNotificationObserver : NSObject 35 | @property (readonly, nonatomic, weak) UIRefreshControl *refreshControl; 36 | - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl; 37 | 38 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 39 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 40 | #endif 41 | - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation; 42 | 43 | @end 44 | 45 | @implementation UIRefreshControl (AFNetworking) 46 | 47 | - (AFRefreshControlNotificationObserver *)af_notificationObserver { 48 | AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); 49 | if (notificationObserver == nil) { 50 | notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self]; 51 | objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 52 | } 53 | return notificationObserver; 54 | } 55 | 56 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 57 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { 58 | [[self af_notificationObserver] setRefreshingWithStateOfTask:task]; 59 | } 60 | #endif 61 | 62 | - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation { 63 | [[self af_notificationObserver] setRefreshingWithStateOfOperation:operation]; 64 | } 65 | 66 | @end 67 | 68 | @implementation AFRefreshControlNotificationObserver 69 | 70 | - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl 71 | { 72 | self = [super init]; 73 | if (self) { 74 | _refreshControl = refreshControl; 75 | } 76 | return self; 77 | } 78 | 79 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 80 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { 81 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 82 | 83 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 84 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 85 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 86 | 87 | if (task) { 88 | #pragma clang diagnostic push 89 | #pragma clang diagnostic ignored "-Wreceiver-is-weak" 90 | #pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" 91 | if (task.state == NSURLSessionTaskStateRunning) { 92 | [self.refreshControl beginRefreshing]; 93 | 94 | [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task]; 95 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task]; 96 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task]; 97 | } else { 98 | [self.refreshControl endRefreshing]; 99 | } 100 | #pragma clang diagnostic pop 101 | } 102 | } 103 | #endif 104 | 105 | - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation { 106 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 107 | 108 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil]; 109 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil]; 110 | 111 | if (operation) { 112 | #pragma clang diagnostic push 113 | #pragma clang diagnostic ignored "-Wreceiver-is-weak" 114 | #pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" 115 | if (![operation isFinished]) { 116 | if ([operation isExecuting]) { 117 | [self.refreshControl beginRefreshing]; 118 | } else { 119 | [self.refreshControl endRefreshing]; 120 | } 121 | 122 | [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingOperationDidStartNotification object:operation]; 123 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingOperationDidFinishNotification object:operation]; 124 | } 125 | #pragma clang diagnostic pop 126 | } 127 | } 128 | 129 | #pragma mark - 130 | 131 | - (void)af_beginRefreshing { 132 | dispatch_async(dispatch_get_main_queue(), ^{ 133 | #pragma clang diagnostic push 134 | #pragma clang diagnostic ignored "-Wreceiver-is-weak" 135 | [self.refreshControl beginRefreshing]; 136 | #pragma clang diagnostic pop 137 | }); 138 | } 139 | 140 | - (void)af_endRefreshing { 141 | dispatch_async(dispatch_get_main_queue(), ^{ 142 | #pragma clang diagnostic push 143 | #pragma clang diagnostic ignored "-Wreceiver-is-weak" 144 | [self.refreshControl endRefreshing]; 145 | #pragma clang diagnostic pop 146 | }); 147 | } 148 | 149 | #pragma mark - 150 | 151 | - (void)dealloc { 152 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 153 | 154 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 155 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 156 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 157 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 158 | #endif 159 | 160 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil]; 161 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil]; 162 | } 163 | 164 | @end 165 | 166 | #endif 167 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIWebView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFHTTPRequestSerializer, AFHTTPResponseSerializer; 33 | @protocol AFURLRequestSerialization, AFURLResponseSerialization; 34 | 35 | /** 36 | 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. 37 | 38 | @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. 39 | */ 40 | @interface UIWebView (AFNetworking) 41 | 42 | /** 43 | The request serializer used to serialize requests made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPRequestSerializer`. 44 | */ 45 | @property (nonatomic, strong) AFHTTPRequestSerializer * requestSerializer; 46 | 47 | /** 48 | The response serializer used to serialize responses made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPResponseSerializer`. 49 | */ 50 | @property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; 51 | 52 | /** 53 | Asynchronously loads the specified request. 54 | 55 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 56 | @param progress 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 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 main thread. 57 | @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. 58 | @param failure A block object to be executed when the request operation 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. 59 | */ 60 | - (void)loadRequest:(NSURLRequest *)request 61 | progress:(nullable void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress 62 | success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 63 | failure:(nullable void (^)(NSError *error))failure; 64 | 65 | /** 66 | Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. 67 | 68 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 69 | @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. 70 | @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. 71 | @param progress 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 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 main thread. 72 | @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. 73 | @param failure A block object to be executed when the request operation 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. 74 | */ 75 | - (void)loadRequest:(NSURLRequest *)request 76 | MIMEType:(nullable NSString *)MIMEType 77 | textEncodingName:(nullable NSString *)textEncodingName 78 | progress:(nullable void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress 79 | success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 80 | failure:(nullable void (^)(NSError *error))failure; 81 | 82 | @end 83 | 84 | NS_ASSUME_NONNULL_END 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIWebView+AFNetworking.m 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIWebView+AFNetworking.h" 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import "AFHTTPRequestOperation.h" 29 | #import "AFURLResponseSerialization.h" 30 | #import "AFURLRequestSerialization.h" 31 | 32 | @interface UIWebView (_AFNetworking) 33 | @property (readwrite, nonatomic, strong, setter = af_setHTTPRequestOperation:) AFHTTPRequestOperation *af_HTTPRequestOperation; 34 | @end 35 | 36 | @implementation UIWebView (_AFNetworking) 37 | 38 | - (AFHTTPRequestOperation *)af_HTTPRequestOperation { 39 | return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_HTTPRequestOperation)); 40 | } 41 | 42 | - (void)af_setHTTPRequestOperation:(AFHTTPRequestOperation *)operation { 43 | objc_setAssociatedObject(self, @selector(af_HTTPRequestOperation), operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 44 | } 45 | 46 | @end 47 | 48 | #pragma mark - 49 | 50 | @implementation UIWebView (AFNetworking) 51 | 52 | - (AFHTTPRequestSerializer *)requestSerializer { 53 | static AFHTTPRequestSerializer *_af_defaultRequestSerializer = nil; 54 | static dispatch_once_t onceToken; 55 | dispatch_once(&onceToken, ^{ 56 | _af_defaultRequestSerializer = [AFHTTPRequestSerializer serializer]; 57 | }); 58 | 59 | #pragma clang diagnostic push 60 | #pragma clang diagnostic ignored "-Wgnu" 61 | return objc_getAssociatedObject(self, @selector(requestSerializer)) ?: _af_defaultRequestSerializer; 62 | #pragma clang diagnostic pop 63 | } 64 | 65 | - (void)setRequestSerializer:(AFHTTPRequestSerializer *)requestSerializer { 66 | objc_setAssociatedObject(self, @selector(requestSerializer), requestSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 67 | } 68 | 69 | - (AFHTTPResponseSerializer *)responseSerializer { 70 | static AFHTTPResponseSerializer *_af_defaultResponseSerializer = nil; 71 | static dispatch_once_t onceToken; 72 | dispatch_once(&onceToken, ^{ 73 | _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer]; 74 | }); 75 | 76 | #pragma clang diagnostic push 77 | #pragma clang diagnostic ignored "-Wgnu" 78 | return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer; 79 | #pragma clang diagnostic pop 80 | } 81 | 82 | - (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { 83 | objc_setAssociatedObject(self, @selector(responseSerializer), responseSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 84 | } 85 | 86 | #pragma mark - 87 | 88 | - (void)loadRequest:(NSURLRequest *)request 89 | progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress 90 | success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 91 | failure:(void (^)(NSError *error))failure 92 | { 93 | [self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) { 94 | NSStringEncoding stringEncoding = NSUTF8StringEncoding; 95 | if (response.textEncodingName) { 96 | CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName); 97 | if (encoding != kCFStringEncodingInvalidId) { 98 | stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding); 99 | } 100 | } 101 | 102 | NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding]; 103 | if (success) { 104 | string = success(response, string); 105 | } 106 | 107 | return [string dataUsingEncoding:stringEncoding]; 108 | } failure:failure]; 109 | } 110 | 111 | - (void)loadRequest:(NSURLRequest *)request 112 | MIMEType:(NSString *)MIMEType 113 | textEncodingName:(NSString *)textEncodingName 114 | progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress 115 | success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 116 | failure:(void (^)(NSError *error))failure 117 | { 118 | NSParameterAssert(request); 119 | 120 | if (self.af_HTTPRequestOperation) { 121 | [self.af_HTTPRequestOperation cancel]; 122 | } 123 | 124 | request = [self.requestSerializer requestBySerializingRequest:request withParameters:nil error:nil]; 125 | 126 | self.af_HTTPRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; 127 | self.af_HTTPRequestOperation.responseSerializer = self.responseSerializer; 128 | 129 | __weak __typeof(self)weakSelf = self; 130 | [self.af_HTTPRequestOperation setDownloadProgressBlock:progress]; 131 | [self.af_HTTPRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id __unused responseObject) { 132 | NSData *data = success ? success(operation.response, operation.responseData) : operation.responseData; 133 | 134 | #pragma clang diagnostic push 135 | #pragma clang diagnostic ignored "-Wgnu" 136 | __strong __typeof(weakSelf) strongSelf = weakSelf; 137 | [strongSelf loadData:data MIMEType:(MIMEType ?: [operation.response MIMEType]) textEncodingName:(textEncodingName ?: [operation.response textEncodingName]) baseURL:[operation.response URL]]; 138 | 139 | if ([strongSelf.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { 140 | [strongSelf.delegate webViewDidFinishLoad:strongSelf]; 141 | } 142 | 143 | #pragma clang diagnostic pop 144 | } failure:^(AFHTTPRequestOperation * __unused operation, NSError *error) { 145 | if (failure) { 146 | failure(error); 147 | } 148 | }]; 149 | 150 | [self.af_HTTPRequestOperation start]; 151 | 152 | if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { 153 | [self.delegate webViewDidStartLoad:self]; 154 | } 155 | } 156 | 157 | @end 158 | 159 | #endif 160 | -------------------------------------------------------------------------------- /Pods/DDPicUploader/DDPicClient/DDPicClient.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDPicClient.h 3 | // DDFeedbackDemo 4 | // 5 | // Created by im61 on 15/10/11. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DDPicClient : NSObject 12 | 13 | + (instancetype)sharedClient; 14 | 15 | - (void)upload:(NSData *)data 16 | imageName:(NSString *)imageName 17 | completion:(void (^)(NSError *error, NSString *url, NSDictionary *result))completion; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/DDPicUploader/DDPicClient/DDPicClient.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDPicClient.m 3 | // DDFeedbackDemo 4 | // 5 | // Created by im61 on 15/10/11. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import "DDPicClient.h" 10 | #import "AFHTTPSessionManager.h" 11 | #import "AFURLRequestSerialization.h" 12 | #import "AFHTTPRequestOperationManager.h" 13 | 14 | static NSString * const kPicpxBaseURL = @"http://picpx.com"; 15 | static NSString * const kUpyunBaseURL = @"http://v0.api.upyun.com"; 16 | static NSString * const kImageBaseURL = @"http://deeppic.b0.upaiyun.com"; 17 | 18 | @interface DDPicClient () 19 | 20 | @property (nonatomic, strong) AFHTTPSessionManager *picPxManager; 21 | @property (nonatomic, strong) AFHTTPSessionManager *upyunManager; 22 | 23 | @end 24 | 25 | 26 | @implementation DDPicClient 27 | 28 | + (instancetype)sharedClient { 29 | static DDPicClient *_sharedClient = nil; 30 | static dispatch_once_t onceToken; 31 | 32 | dispatch_once(&onceToken, ^{ 33 | _sharedClient = [[DDPicClient alloc] init]; 34 | }); 35 | 36 | return _sharedClient; 37 | } 38 | 39 | - (instancetype)init { 40 | self = [super init]; 41 | 42 | if (self) { 43 | _picPxManager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:kPicpxBaseURL]]; 44 | _picPxManager.requestSerializer = [AFJSONRequestSerializer serializer]; 45 | _picPxManager.responseSerializer = [AFJSONResponseSerializer serializer]; 46 | 47 | _upyunManager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:kUpyunBaseURL]]; 48 | _upyunManager.requestSerializer = [AFJSONRequestSerializer serializer]; 49 | _upyunManager.responseSerializer = [AFHTTPResponseSerializer serializer]; 50 | } 51 | 52 | return self; 53 | } 54 | 55 | - (void)upload:(NSData *)data 56 | imageName:(NSString *)imageName 57 | completion:(void (^)(NSError *error, NSString *url, NSDictionary *result))completion { 58 | [self requestPolicyAndSignatureWithImageName:imageName Completion:^(NSError *error, NSDictionary *result) { 59 | if (error) { 60 | if (completion) { 61 | completion(error, nil, nil); 62 | } 63 | } else { 64 | NSString *policy = result[@"policy"]; 65 | NSString *signature = result[@"signature"]; 66 | 67 | [self upload:data 68 | imageName:imageName 69 | policy:policy 70 | signature:signature 71 | completion:^(NSError *error, NSDictionary *result) { 72 | NSURL *baseURL = [NSURL URLWithString:kImageBaseURL]; 73 | NSString *path = result[@"url"]; 74 | NSURL *imageURL = [NSURL URLWithString:path relativeToURL:baseURL]; 75 | 76 | if (completion) { 77 | completion(error, imageURL.absoluteString, result); 78 | } 79 | }]; 80 | } 81 | }]; 82 | } 83 | 84 | - (void)requestPolicyAndSignatureWithImageName:(NSString *)imageName Completion:(void (^)(NSError *error, NSDictionary *result))completion { 85 | [_picPxManager POST:@"uptoken" 86 | parameters:@{@"image": imageName} 87 | success:^(NSURLSessionDataTask *task, id responseObject) { 88 | if (completion) { 89 | completion(nil, responseObject); 90 | } 91 | } failure:^(NSURLSessionDataTask *task, NSError *error) { 92 | if (completion) { 93 | completion(error, nil); 94 | } 95 | }]; 96 | } 97 | 98 | - (void)upload:(NSData *)data 99 | imageName:(NSString *)imageName 100 | policy:(NSString *)policy 101 | signature:(NSString *)signature 102 | completion:(void (^)(NSError *error, NSDictionary *result))completion { 103 | NSDictionary *params = @{@"policy": policy, @"signature": signature}; 104 | 105 | [_upyunManager POST:@"deeppic" 106 | parameters:params constructingBodyWithBlock:^(id _Nonnull formData) { 107 | [formData appendPartWithFileData:data name:@"file" fileName:imageName mimeType:@"image/png"]; 108 | } success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) { 109 | NSDictionary *result = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil]; 110 | if (completion) { 111 | completion(nil, result); 112 | } 113 | } failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) { 114 | if (completion) { 115 | completion(error, nil); 116 | } 117 | }]; 118 | } 119 | @end 120 | -------------------------------------------------------------------------------- /Pods/DDPicUploader/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 DeepDevelop-Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Pods/DDPicUploader/README.md: -------------------------------------------------------------------------------- 1 | # DDPicUploader 2 | 3 | DDPicUploader is a simple client upload image to picpx.com. Written in Objective-c. 4 | 5 | ## Installation 6 | 7 | #### CocoaPods 8 | 9 | pod 'DDPicUploader' 10 | 11 | #### Source File 12 | You can copy all the files under the `DDPicUploader` folder into your project. 13 | 14 | ## iOS 9 15 | 16 | You need add exception domains in your plist file 17 | 18 | picpx.com 19 | v0.api.upyun.com 20 | 21 | ## Usage 22 | 23 | ```objective-c 24 | 25 | [[DDPicClient sharedClient] upload:image 26 | imageName:@"screencapture.png" 27 | completion:^(NSError *error, NSDictionary *result) { 28 | }]; 29 | 30 | ``` 31 | 32 | ## Dependency 33 | 34 | - AFNetworking 35 | 36 | ## Author 37 | 38 | Liu Yi, 61upup@gmail.com 39 | 40 | ## License 41 | 42 | DDPicUploader is available under the MIT license. See the LICENSE file for more info. 43 | -------------------------------------------------------------------------------- /Pods/DDSlackWebhook/DDSlackWebhook/DDSlackWebHookClient.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDSlackWebhookClient.h 3 | // SlackIncomingWebhooksDemo 4 | // 5 | // Created by im61 on 15/10/11. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | @interface DDSlackWebhookClient : NSObject 13 | 14 | /** 15 | * Initialize DDSlackWebhookClient. Call this method within your App Delegate's `application:didFinishLaunchingWithOptions:` and provide the slack incoming webhook url 16 | * 17 | * @param webhookURL the incoming webhook url from your Slack 18 | * 19 | * @return Returns the shared Fabric instance. In most cases this can be ignored. 20 | */ 21 | 22 | + (instancetype)withWebhookURL:(NSURL *)webhookURL; 23 | 24 | /** 25 | * Returns the DDSlackWebhookClient singleton object. 26 | */ 27 | 28 | + (instancetype)sharedClient; 29 | 30 | /** 31 | * Post notification to Slack Channel or a Direct Message to someone 32 | * 33 | * @param channel channel name or user id. example: #general or @61 34 | * @param text notification content 35 | * @param username displayed name 36 | * @param iconURL bot icon url 37 | * @param iconEmoji bot icon emoji 38 | * @param completion callback 39 | */ 40 | 41 | - (void)postNotificationToChannel:(NSString *)channel 42 | text:(NSString *)text 43 | username:(NSString *)username 44 | iconURL:(NSURL *)iconURL 45 | iconEmoji:(NSString *)iconEmoji 46 | completion:(void (^)(NSError *error))completion; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/DDSlackWebhook/DDSlackWebhook/DDSlackWebhookClient.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDSlackWebHookClient.m 3 | // SlackIncomingWebhooksDemo 4 | // 5 | // Created by im61 on 15/10/11. 6 | // Copyright © 2015年 DeepDevelop. All rights reserved. 7 | // 8 | 9 | #import "DDSlackWebhookClient.h" 10 | #import "AFHTTPSessionManager.h" 11 | #import "AFURLRequestSerialization.h" 12 | #import "AFHTTPRequestOperationManager.h" 13 | 14 | @interface DDSlackWebhookClient () 15 | 16 | @property (nonatomic, strong) AFHTTPSessionManager *manager; 17 | @property (nonatomic, strong) NSURL *webhookURL; 18 | @property (nonatomic, strong) NSString *path; 19 | 20 | @end 21 | 22 | @implementation DDSlackWebhookClient 23 | 24 | + (instancetype)withWebhookURL:(NSURL *)webhookURL { 25 | DDSlackWebhookClient *client = [DDSlackWebhookClient sharedClient]; 26 | 27 | static dispatch_once_t onceToken; 28 | 29 | dispatch_once(&onceToken, ^{ 30 | client.webhookURL = webhookURL; 31 | }); 32 | 33 | return client; 34 | } 35 | 36 | + (instancetype)sharedClient { 37 | static DDSlackWebhookClient *_sharedClient = nil; 38 | static dispatch_once_t onceToken; 39 | 40 | dispatch_once(&onceToken, ^{ 41 | _sharedClient = [[DDSlackWebhookClient alloc] init]; 42 | }); 43 | 44 | return _sharedClient; 45 | } 46 | 47 | - (void)setWebhookURL:(NSURL *)webhookURL { 48 | _webhookURL = webhookURL; 49 | 50 | NSString *baseURLString = [NSString stringWithFormat:@"%@://%@", _webhookURL.scheme, _webhookURL.host]; 51 | NSString *path = [[[_webhookURL pathComponents] componentsJoinedByString:@"/"] substringFromIndex:2]; 52 | 53 | self.manager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:baseURLString]]; 54 | self.manager.requestSerializer = [AFJSONRequestSerializer serializer]; 55 | self.manager.responseSerializer = [AFHTTPResponseSerializer serializer]; 56 | 57 | self.path = path; 58 | } 59 | 60 | - (void)postNotificationToChannel:(NSString *)channel 61 | text:(NSString *)text 62 | username:(NSString *)username 63 | iconURL:(NSURL *)iconURL 64 | iconEmoji:(NSString *)iconEmoji 65 | completion:(void (^)(NSError *error))completion { 66 | NSMutableDictionary *params = [NSMutableDictionary dictionary]; 67 | 68 | if (channel) { 69 | params[@"channel"] = channel; 70 | } 71 | 72 | if (!text) { 73 | text = @"test incoming webhook"; 74 | } 75 | 76 | if (username) { 77 | params[@"username"] = username; 78 | } 79 | 80 | if (iconURL) { 81 | params[@"icon_url"] = iconURL.absoluteString; 82 | } 83 | 84 | if (iconEmoji) { 85 | params[@"icon_emoji"] = iconEmoji; 86 | } 87 | 88 | params[@"text"] = text; 89 | 90 | [self.manager POST:self.path 91 | parameters:params 92 | success:^(NSURLSessionDataTask *task, id responseObject) { 93 | if (completion) { 94 | completion(nil); 95 | } 96 | } failure:^(NSURLSessionDataTask *task, NSError *error) { 97 | if (completion) { 98 | completion(error); 99 | } 100 | }]; 101 | } 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /Pods/DDSlackWebhook/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 DeepDevelop-Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Pods/DDSlackWebhook/README.md: -------------------------------------------------------------------------------- 1 | # DDSlackWebhook 2 | 3 | DDSlackWebhook is a simple client post notification to your slack channel use slack incoming webhooks. Written in Objective-c. 4 | 5 | ## Installation 6 | 7 | #### CocoaPods 8 | 9 | 10 | #### Source File 11 | You can copy all the files under the `DDSlackWebhook` folder into your project. 12 | 13 | ## Usage 14 | 15 | ```objective-c 16 | 17 | // Config 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | [DDSlackWebhookClient withWebhookURL:[NSURL URLWithString:@""]]; 20 | 21 | return YES; 22 | } 23 | 24 | // Post 25 | [[DDSlackWebhookClient sharedClient] postNotificationToChannel:nil 26 | text:nil 27 | username:nil 28 | iconURL:nil 29 | iconEmoji:nil 30 | completion:nil]; 31 | 32 | ``` 33 | 34 | ## Dependency 35 | 36 | - AFNetworking 37 | 38 | ## Author 39 | 40 | Liu Yi, 61upup@gmail.com 41 | 42 | ## License 43 | 44 | DDSlackWebhook is available under the MIT license. See the LICENSE file for more info. -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLConnectionOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/DDPicUploader/DDPicClient.h: -------------------------------------------------------------------------------- 1 | ../../../DDPicUploader/DDPicClient/DDPicClient.h -------------------------------------------------------------------------------- /Pods/Headers/Private/DDSlackWebhook/DDSlackWebHookClient.h: -------------------------------------------------------------------------------- 1 | ../../../DDSlackWebhook/DDSlackWebhook/DDSlackWebHookClient.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPRequestOperationManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLConnectionOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLConnectionOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/DDPicUploader/DDPicClient.h: -------------------------------------------------------------------------------- 1 | ../../../DDPicUploader/DDPicClient/DDPicClient.h -------------------------------------------------------------------------------- /Pods/Headers/Public/DDSlackWebhook/DDSlackWebHookClient.h: -------------------------------------------------------------------------------- 1 | ../../../DDSlackWebhook/DDSlackWebhook/DDSlackWebHookClient.h -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.6.0): 3 | - AFNetworking/NSURLConnection (= 2.6.0) 4 | - AFNetworking/NSURLSession (= 2.6.0) 5 | - AFNetworking/Reachability (= 2.6.0) 6 | - AFNetworking/Security (= 2.6.0) 7 | - AFNetworking/Serialization (= 2.6.0) 8 | - AFNetworking/UIKit (= 2.6.0) 9 | - AFNetworking/NSURLConnection (2.6.0): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.6.0): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.6.0) 18 | - AFNetworking/Security (2.6.0) 19 | - AFNetworking/Serialization (2.6.0) 20 | - AFNetworking/UIKit (2.6.0): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | - DDPicUploader (1.0): 24 | - AFNetworking (~> 2.5) 25 | - DDSlackWebhook (1.0): 26 | - AFNetworking (~> 2.5) 27 | 28 | DEPENDENCIES: 29 | - DDPicUploader 30 | - DDSlackWebhook 31 | 32 | SPEC CHECKSUMS: 33 | AFNetworking: 79f7eb1a0fcfa7beb409332b2ca49afe9ce53b05 34 | DDPicUploader: 4f31d3ef584c1d7886536f92ce0edaf02be2242a 35 | DDSlackWebhook: 9e41fa2306e35c398c9353698a588289e4bd98cc 36 | 37 | COCOAPODS: 0.38.2 38 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "AFNetworking.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | 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/DDPicUploader" "${PODS_ROOT}/Headers/Public/DDSlackWebhook" 4 | OTHER_LDFLAGS = ${AFNETWORKING_OTHER_LDFLAGS} 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #ifndef TARGET_OS_IOS 6 | #define TARGET_OS_IOS TARGET_OS_IPHONE 7 | #endif 8 | 9 | #ifndef TARGET_OS_WATCH 10 | #define TARGET_OS_WATCH 0 11 | #endif 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | AFNETWORKING_OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" -------------------------------------------------------------------------------- /Pods/Target Support Files/DDPicUploader/DDPicUploader-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "DDPicUploader.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/DDPicUploader" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/DDPicUploader" "${PODS_ROOT}/Headers/Public/DDSlackWebhook" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/DDPicUploader/DDPicUploader-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_DDPicUploader : NSObject 3 | @end 4 | @implementation PodsDummy_DDPicUploader 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/DDPicUploader/DDPicUploader-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/DDPicUploader/DDPicUploader.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepdevelop/DDSlackFeedback/208c325c02171b381f9608322f434116c913abe2/Pods/Target Support Files/DDPicUploader/DDPicUploader.xcconfig -------------------------------------------------------------------------------- /Pods/Target Support Files/DDSlackWebhook/DDSlackWebhook-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "DDSlackWebhook.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/DDSlackWebhook" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/DDPicUploader" "${PODS_ROOT}/Headers/Public/DDSlackWebhook" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/DDSlackWebhook/DDSlackWebhook-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_DDSlackWebhook : NSObject 3 | @end 4 | @implementation PodsDummy_DDSlackWebhook 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/DDSlackWebhook/DDSlackWebhook-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/DDSlackWebhook/DDSlackWebhook.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepdevelop/DDSlackFeedback/208c325c02171b381f9608322f434116c913abe2/Pods/Target Support Files/DDSlackWebhook/DDSlackWebhook.xcconfig -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-DDFeedbackDemo/Pods-DDFeedbackDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## DDPicUploader 28 | 29 | The MIT License (MIT) 30 | 31 | Copyright (c) 2015 DeepDevelop-Inc 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all 41 | copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 49 | SOFTWARE. 50 | 51 | ## DDSlackWebhook 52 | 53 | The MIT License (MIT) 54 | 55 | Copyright (c) 2015 DeepDevelop-Inc 56 | 57 | Permission is hereby granted, free of charge, to any person obtaining a copy 58 | of this software and associated documentation files (the "Software"), to deal 59 | in the Software without restriction, including without limitation the rights 60 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 61 | copies of the Software, and to permit persons to whom the Software is 62 | furnished to do so, subject to the following conditions: 63 | 64 | The above copyright notice and this permission notice shall be included in all 65 | copies or substantial portions of the Software. 66 | 67 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 68 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 69 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 70 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 71 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 72 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 73 | SOFTWARE. 74 | Generated by CocoaPods - http://cocoapods.org 75 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-DDFeedbackDemo/Pods-DDFeedbackDemo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | AFNetworking 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | The MIT License (MIT) 45 | 46 | Copyright (c) 2015 DeepDevelop-Inc 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy 49 | of this software and associated documentation files (the "Software"), to deal 50 | in the Software without restriction, including without limitation the rights 51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 52 | copies of the Software, and to permit persons to whom the Software is 53 | furnished to do so, subject to the following conditions: 54 | 55 | The above copyright notice and this permission notice shall be included in all 56 | copies or substantial portions of the Software. 57 | 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 64 | SOFTWARE. 65 | Title 66 | DDPicUploader 67 | Type 68 | PSGroupSpecifier 69 | 70 | 71 | FooterText 72 | The MIT License (MIT) 73 | 74 | Copyright (c) 2015 DeepDevelop-Inc 75 | 76 | Permission is hereby granted, free of charge, to any person obtaining a copy 77 | of this software and associated documentation files (the "Software"), to deal 78 | in the Software without restriction, including without limitation the rights 79 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 80 | copies of the Software, and to permit persons to whom the Software is 81 | furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all 84 | copies or substantial portions of the Software. 85 | 86 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 87 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 88 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 89 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 90 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 91 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 92 | SOFTWARE. 93 | Title 94 | DDSlackWebhook 95 | Type 96 | PSGroupSpecifier 97 | 98 | 99 | FooterText 100 | Generated by CocoaPods - http://cocoapods.org 101 | Title 102 | 103 | Type 104 | PSGroupSpecifier 105 | 106 | 107 | StringsTable 108 | Acknowledgements 109 | Title 110 | Acknowledgements 111 | 112 | 113 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-DDFeedbackDemo/Pods-DDFeedbackDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_DDFeedbackDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_DDFeedbackDemo 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-DDFeedbackDemo/Pods-DDFeedbackDemo-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-DDFeedbackDemo/Pods-DDFeedbackDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/DDPicUploader" "${PODS_ROOT}/Headers/Public/DDSlackWebhook" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/DDPicUploader" -isystem "${PODS_ROOT}/Headers/Public/DDSlackWebhook" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"DDPicUploader" -l"DDSlackWebhook" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-DDFeedbackDemo/Pods-DDFeedbackDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/DDPicUploader" "${PODS_ROOT}/Headers/Public/DDSlackWebhook" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/DDPicUploader" -isystem "${PODS_ROOT}/Headers/Public/DDSlackWebhook" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"DDPicUploader" -l"DDSlackWebhook" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DDSlackFeedback 2 | 3 | DDSlackFeedback help you easily post user text or image feedback to your slack channel, The only the your need 4 | to do is shake your device. 5 | 6 | ## Installation 7 | 8 | #### CocoaPods 9 | platform :ios, '8.0' 10 | pod 'DDSlackFeedback' 11 | 12 | #### Source File 13 | You can copy all the files under the `DDSlackFeedback` folder into your project. 14 | 15 | ## iOS 9 16 | 17 | You need add exception domains in your plist file 18 | 19 | picpx.com 20 | v0.api.upyun.com 21 | 22 | ## Usage 23 | 24 | ```objective-c 25 | 26 | [DDSlackFeedbackManager withWebhookURL:[NSURL URLWithString:YOURWEBHOOKURL]]; 27 | 28 | ``` 29 | 30 | ## Author 31 | 32 | Liu Yi, 61upup@gmail.com 33 | 34 | ## License 35 | 36 | DDSlackFeedback is available under the MIT license. See the LICENSE file for more info. 37 | --------------------------------------------------------------------------------