From df25091fa2c33e26479ac37a3ee964ab2507cd4d Mon Sep 17 00:00:00 2001 From: Sumeru Chatterjee Date: Mon, 18 Dec 2017 18:00:22 +0100 Subject: [PATCH 1/2] Solution for assessment --- client/.gitignore | 1 + client/CoolCards.xcodeproj/project.pbxproj | 942 +++++++ .../contents.xcworkspacedata | 7 + .../contents.xcworkspacedata | 10 + client/CoolCards/AppDelegate.swift | 46 + .../CoolCardsAPI/CoolCardAPIRequest.swift | 55 + .../CoolCards/CoolCardsAPI/CoolCardsAPI.swift | 50 + .../CoolCardsAPI/DataEntities/Card.swift | 53 + client/CoolCards/Info.plist | 51 + .../AppIcon.appiconset/Contents.json | 98 + .../BaseFlowCollectionViewController.swift | 64 + .../CoolCardsDetailViewController.swift | 83 + .../CoolCardsDetailViewController.xib | 60 + .../CoolCardsDetailViewModel.swift | 29 + .../FavoritesProvider.swift | 34 + .../CoolCardsCollectionViewCell.swift | 34 + .../CoolCardsCollectionViewCell.xib | 42 + .../CoolCardsViewController.swift | 81 + .../CoolCardsViewModel.swift | 29 + .../UICollectionView+Extensions.swift | 29 + .../UI/Extension/UIImageView+Extensions.swift | 23 + .../UI/Extension/UIView+Extensions.swift | 32 + .../Base.lproj/LaunchScreen.storyboard | 25 + .../UI/Storyboards/Base.lproj/Main.storyboard | 77 + .../CoolCardsIntegrationTests.swift | 41 + client/CoolCardsIntegrationTests/Info.plist | 22 + client/CoolCardsTests/CoolCardsTests.swift | 36 + client/CoolCardsTests/Info.plist | 22 + client/Podfile | 22 + client/Podfile.lock | 28 + client/Pods/Alamofire/LICENSE | 19 + client/Pods/Alamofire/README.md | 1862 ++++++++++++++ client/Pods/Alamofire/Source/AFError.swift | 460 ++++ client/Pods/Alamofire/Source/Alamofire.swift | 465 ++++ .../Source/DispatchQueue+Alamofire.swift | 37 + .../Alamofire/Source/MultipartFormData.swift | 580 +++++ .../Source/NetworkReachabilityManager.swift | 233 ++ .../Pods/Alamofire/Source/Notifications.swift | 52 + .../Alamofire/Source/ParameterEncoding.swift | 432 ++++ client/Pods/Alamofire/Source/Request.swift | 653 +++++ client/Pods/Alamofire/Source/Response.swift | 465 ++++ .../Source/ResponseSerialization.swift | 715 ++++++ client/Pods/Alamofire/Source/Result.swift | 300 +++ .../Alamofire/Source/ServerTrustPolicy.swift | 307 +++ .../Alamofire/Source/SessionDelegate.swift | 719 ++++++ .../Alamofire/Source/SessionManager.swift | 891 +++++++ .../Pods/Alamofire/Source/TaskDelegate.swift | 466 ++++ client/Pods/Alamofire/Source/Timeline.swift | 136 + client/Pods/Alamofire/Source/Validation.swift | 315 +++ .../FontAwesome.swift/FontAwesome/Enum.swift | 1584 ++++++++++++ .../FontAwesome/FontAwesome.otf | Bin 0 -> 134808 bytes .../FontAwesome/FontAwesome.swift | 182 ++ .../FontAwesomeBarButtonItem.swift | 73 + .../FontAwesomeImageRepresentable.swift | 55 + .../FontAwesome/FontAwesomeImageView.swift | 58 + .../FontAwesomeSegmentedControl.swift | 74 + .../FontAwesomeStateRequirement.swift | 29 + .../FontAwesome/FontAwesomeTabBarItem.swift | 62 + .../FontAwesomeTextRepresentable.swift | 53 + .../FontAwesome/FontAwesomeView.swift | 70 + client/Pods/FontAwesome.swift/LICENSE | 19 + client/Pods/FontAwesome.swift/README.md | 98 + client/Pods/Manifest.lock | 28 + client/Pods/Moya/License.md | 21 + client/Pods/Moya/Readme.md | 322 +++ .../Pods/Moya/Sources/Moya/AnyEncodable.swift | 14 + .../Pods/Moya/Sources/Moya/Cancellable.swift | 22 + client/Pods/Moya/Sources/Moya/Endpoint.swift | 120 + client/Pods/Moya/Sources/Moya/Image.swift | 10 + .../Moya/Sources/Moya/Moya+Alamofire.swift | 88 + client/Pods/Moya/Sources/Moya/MoyaError.swift | 75 + .../Sources/Moya/MoyaProvider+Defaults.swift | 36 + .../Sources/Moya/MoyaProvider+Internal.swift | 263 ++ .../Pods/Moya/Sources/Moya/MoyaProvider.swift | 182 ++ .../Pods/Moya/Sources/Moya/MultiTarget.swift | 46 + .../Moya/Sources/Moya/MultipartFormData.swift | 59 + client/Pods/Moya/Sources/Moya/Plugin.swift | 47 + .../Moya/Plugins/AccessTokenPlugin.swift | 73 + .../Moya/Plugins/CredentialsPlugin.swift | 21 + .../Moya/Plugins/NetworkActivityPlugin.swift | 30 + .../Moya/Plugins/NetworkLoggerPlugin.swift | 113 + client/Pods/Moya/Sources/Moya/Response.swift | 144 ++ .../Pods/Moya/Sources/Moya/TargetType.swift | 32 + client/Pods/Moya/Sources/Moya/Task.swift | 38 + client/Pods/Moya/Sources/Moya/URL+Moya.swift | 16 + .../Sources/Moya/URLRequest+Encoding.swift | 22 + client/Pods/Pods.xcodeproj/project.pbxproj | 2227 +++++++++++++++++ client/Pods/Result/LICENSE | 21 + client/Pods/Result/README.md | 113 + client/Pods/Result/Result/Result.swift | 276 ++ .../Pods/Result/Result/ResultProtocol.swift | 203 ++ client/Pods/SDWebImage/LICENSE | 20 + client/Pods/SDWebImage/README.md | 214 ++ .../SDWebImage/NSData+ImageContentType.h | 42 + .../SDWebImage/NSData+ImageContentType.m | 98 + .../SDWebImage/SDWebImage/NSImage+WebCache.h | 23 + .../SDWebImage/SDWebImage/NSImage+WebCache.m | 41 + .../Pods/SDWebImage/SDWebImage/SDImageCache.h | 266 ++ .../Pods/SDWebImage/SDWebImage/SDImageCache.m | 636 +++++ .../SDWebImage/SDImageCacheConfig.h | 46 + .../SDWebImage/SDImageCacheConfig.m | 27 + .../SDWebImage/SDWebImage/SDWebImageCoder.h | 119 + .../SDWebImage/SDWebImage/SDWebImageCoder.m | 31 + .../SDWebImage/SDWebImageCoderHelper.h | 52 + .../SDWebImage/SDWebImageCoderHelper.m | 255 ++ .../SDWebImage/SDWebImageCodersManager.h | 58 + .../SDWebImage/SDWebImageCodersManager.m | 137 + .../SDWebImage/SDWebImage/SDWebImageCompat.h | 113 + .../SDWebImage/SDWebImage/SDWebImageCompat.m | 63 + .../SDWebImage/SDWebImageDownloader.h | 249 ++ .../SDWebImage/SDWebImageDownloader.m | 333 +++ .../SDWebImageDownloaderOperation.h | 122 + .../SDWebImageDownloaderOperation.m | 495 ++++ .../SDWebImage/SDWebImage/SDWebImageFrame.h | 34 + .../SDWebImage/SDWebImage/SDWebImageFrame.m | 28 + .../SDWebImage/SDWebImageGIFCoder.h | 23 + .../SDWebImage/SDWebImageGIFCoder.m | 183 ++ .../SDWebImage/SDWebImageImageIOCoder.h | 27 + .../SDWebImage/SDWebImageImageIOCoder.m | 557 +++++ .../SDWebImage/SDWebImage/SDWebImageManager.h | 275 ++ .../SDWebImage/SDWebImage/SDWebImageManager.m | 338 +++ .../SDWebImage/SDWebImageOperation.h | 15 + .../SDWebImage/SDWebImagePrefetcher.h | 112 + .../SDWebImage/SDWebImagePrefetcher.m | 142 ++ .../SDWebImage/SDWebImage/UIButton+WebCache.h | 255 ++ .../SDWebImage/SDWebImage/UIButton+WebCache.m | 177 ++ .../SDWebImage/UIImage+ForceDecode.h | 17 + .../SDWebImage/UIImage+ForceDecode.m | 30 + .../Pods/SDWebImage/SDWebImage/UIImage+GIF.h | 25 + .../Pods/SDWebImage/SDWebImage/UIImage+GIF.m | 27 + .../SDWebImage/UIImage+MultiFormat.h | 30 + .../SDWebImage/UIImage+MultiFormat.m | 73 + .../UIImageView+HighlightedWebCache.h | 94 + .../UIImageView+HighlightedWebCache.m | 52 + .../SDWebImage/UIImageView+WebCache.h | 196 ++ .../SDWebImage/UIImageView+WebCache.m | 119 + .../SDWebImage/SDWebImage/UIView+WebCache.h | 112 + .../SDWebImage/SDWebImage/UIView+WebCache.m | 232 ++ .../SDWebImage/UIView+WebCacheOperation.h | 41 + .../SDWebImage/UIView+WebCacheOperation.m | 68 + .../Alamofire/Alamofire-dummy.m | 5 + .../Alamofire/Alamofire-prefix.pch | 12 + .../Alamofire/Alamofire-umbrella.h | 16 + .../Alamofire/Alamofire.modulemap | 6 + .../Alamofire/Alamofire.xcconfig | 10 + .../Target Support Files/Alamofire/Info.plist | 26 + .../FontAwesome.swift-dummy.m | 5 + .../FontAwesome.swift-prefix.pch | 12 + .../FontAwesome.swift-umbrella.h | 16 + .../FontAwesome.swift.modulemap | 6 + .../FontAwesome.swift.xcconfig | 11 + .../FontAwesome.swift/Info.plist | 26 + ...esourceBundle-FontAwesome.swift-Info.plist | 24 + .../Pods/Target Support Files/Moya/Info.plist | 26 + .../Target Support Files/Moya/Moya-dummy.m | 5 + .../Target Support Files/Moya/Moya-prefix.pch | 12 + .../Target Support Files/Moya/Moya-umbrella.h | 16 + .../Target Support Files/Moya/Moya.modulemap | 6 + .../Target Support Files/Moya/Moya.xcconfig | 12 + .../Pods-CoolCards/Info.plist | 26 + .../Pods-CoolCards-acknowledgements.markdown | 122 + .../Pods-CoolCards-acknowledgements.plist | 178 ++ .../Pods-CoolCards/Pods-CoolCards-dummy.m | 5 + .../Pods-CoolCards-frameworks.sh | 120 + .../Pods-CoolCards-resources.sh | 106 + .../Pods-CoolCards/Pods-CoolCards-umbrella.h | 16 + .../Pods-CoolCards.debug.xcconfig | 11 + .../Pods-CoolCards/Pods-CoolCards.modulemap | 6 + .../Pods-CoolCards.release.xcconfig | 11 + .../Pods-CoolCardsIntegrationTests/Info.plist | 26 + ...IntegrationTests-acknowledgements.markdown | 122 + ...rdsIntegrationTests-acknowledgements.plist | 178 ++ .../Pods-CoolCardsIntegrationTests-dummy.m | 5 + ...ds-CoolCardsIntegrationTests-frameworks.sh | 120 + ...ods-CoolCardsIntegrationTests-resources.sh | 106 + .../Pods-CoolCardsIntegrationTests-umbrella.h | 16 + ...s-CoolCardsIntegrationTests.debug.xcconfig | 11 + .../Pods-CoolCardsIntegrationTests.modulemap | 6 + ...CoolCardsIntegrationTests.release.xcconfig | 11 + .../Pods-CoolCardsTests/Info.plist | 26 + ...s-CoolCardsTests-acknowledgements.markdown | 122 + ...Pods-CoolCardsTests-acknowledgements.plist | 178 ++ .../Pods-CoolCardsTests-dummy.m | 5 + .../Pods-CoolCardsTests-frameworks.sh | 120 + .../Pods-CoolCardsTests-resources.sh | 106 + .../Pods-CoolCardsTests-umbrella.h | 16 + .../Pods-CoolCardsTests.debug.xcconfig | 11 + .../Pods-CoolCardsTests.modulemap | 6 + .../Pods-CoolCardsTests.release.xcconfig | 11 + .../Target Support Files/Result/Info.plist | 26 + .../Result/Result-dummy.m | 5 + .../Result/Result-prefix.pch | 12 + .../Result/Result-umbrella.h | 16 + .../Result/Result.modulemap | 6 + .../Result/Result.xcconfig | 10 + .../SDWebImage/Info.plist | 26 + .../SDWebImage/SDWebImage-dummy.m | 5 + .../SDWebImage/SDWebImage-prefix.pch | 12 + .../SDWebImage/SDWebImage-umbrella.h | 40 + .../SDWebImage/SDWebImage.modulemap | 6 + .../SDWebImage/SDWebImage.xcconfig | 10 + server/.dockerignore | 3 + server/.gitignore | 3 + server/Dockerfile | 18 + server/app.py | 19 + server/config.py | 6 + server/db.py | 11 + server/deploy.sh | 30 + server/docker-compose.yml | 5 + server/examples/card1.json | 21 + server/examples/card2.json | 20 + server/models.py | 77 + server/requirements.txt | 12 + server/resources.py | 50 + 214 files changed, 27478 insertions(+) create mode 100644 client/.gitignore create mode 100644 client/CoolCards.xcodeproj/project.pbxproj create mode 100644 client/CoolCards.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 client/CoolCards.xcworkspace/contents.xcworkspacedata create mode 100644 client/CoolCards/AppDelegate.swift create mode 100644 client/CoolCards/CoolCardsAPI/CoolCardAPIRequest.swift create mode 100644 client/CoolCards/CoolCardsAPI/CoolCardsAPI.swift create mode 100644 client/CoolCards/CoolCardsAPI/DataEntities/Card.swift create mode 100644 client/CoolCards/Info.plist create mode 100644 client/CoolCards/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 client/CoolCards/UI/BaseFlowCollectionViewController/BaseFlowCollectionViewController.swift create mode 100644 client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewController.swift create mode 100644 client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewController.xib create mode 100644 client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewModel.swift create mode 100644 client/CoolCards/UI/CoolCardsDetailViewController/FavoritesProvider.swift create mode 100644 client/CoolCards/UI/CoolCardsViewController/CoolCardsCollectionViewCell/CoolCardsCollectionViewCell.swift create mode 100644 client/CoolCards/UI/CoolCardsViewController/CoolCardsCollectionViewCell/CoolCardsCollectionViewCell.xib create mode 100644 client/CoolCards/UI/CoolCardsViewController/CoolCardsViewController.swift create mode 100644 client/CoolCards/UI/CoolCardsViewController/CoolCardsViewModel.swift create mode 100644 client/CoolCards/UI/Extension/UICollectionView+Extensions.swift create mode 100644 client/CoolCards/UI/Extension/UIImageView+Extensions.swift create mode 100644 client/CoolCards/UI/Extension/UIView+Extensions.swift create mode 100644 client/CoolCards/UI/Storyboards/Base.lproj/LaunchScreen.storyboard create mode 100644 client/CoolCards/UI/Storyboards/Base.lproj/Main.storyboard create mode 100644 client/CoolCardsIntegrationTests/CoolCardsIntegrationTests.swift create mode 100644 client/CoolCardsIntegrationTests/Info.plist create mode 100644 client/CoolCardsTests/CoolCardsTests.swift create mode 100644 client/CoolCardsTests/Info.plist create mode 100644 client/Podfile create mode 100644 client/Podfile.lock create mode 100644 client/Pods/Alamofire/LICENSE create mode 100644 client/Pods/Alamofire/README.md create mode 100644 client/Pods/Alamofire/Source/AFError.swift create mode 100644 client/Pods/Alamofire/Source/Alamofire.swift create mode 100644 client/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift create mode 100644 client/Pods/Alamofire/Source/MultipartFormData.swift create mode 100644 client/Pods/Alamofire/Source/NetworkReachabilityManager.swift create mode 100644 client/Pods/Alamofire/Source/Notifications.swift create mode 100644 client/Pods/Alamofire/Source/ParameterEncoding.swift create mode 100644 client/Pods/Alamofire/Source/Request.swift create mode 100644 client/Pods/Alamofire/Source/Response.swift create mode 100644 client/Pods/Alamofire/Source/ResponseSerialization.swift create mode 100644 client/Pods/Alamofire/Source/Result.swift create mode 100644 client/Pods/Alamofire/Source/ServerTrustPolicy.swift create mode 100644 client/Pods/Alamofire/Source/SessionDelegate.swift create mode 100644 client/Pods/Alamofire/Source/SessionManager.swift create mode 100644 client/Pods/Alamofire/Source/TaskDelegate.swift create mode 100644 client/Pods/Alamofire/Source/Timeline.swift create mode 100644 client/Pods/Alamofire/Source/Validation.swift create mode 100644 client/Pods/FontAwesome.swift/FontAwesome/Enum.swift create mode 100644 client/Pods/FontAwesome.swift/FontAwesome/FontAwesome.otf create mode 100644 client/Pods/FontAwesome.swift/FontAwesome/FontAwesome.swift create mode 100644 client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeBarButtonItem.swift create mode 100644 client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeImageRepresentable.swift create mode 100644 client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeImageView.swift create mode 100644 client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeSegmentedControl.swift create mode 100644 client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeStateRequirement.swift create mode 100644 client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeTabBarItem.swift create mode 100644 client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeTextRepresentable.swift create mode 100644 client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeView.swift create mode 100644 client/Pods/FontAwesome.swift/LICENSE create mode 100644 client/Pods/FontAwesome.swift/README.md create mode 100644 client/Pods/Manifest.lock create mode 100644 client/Pods/Moya/License.md create mode 100644 client/Pods/Moya/Readme.md create mode 100644 client/Pods/Moya/Sources/Moya/AnyEncodable.swift create mode 100644 client/Pods/Moya/Sources/Moya/Cancellable.swift create mode 100755 client/Pods/Moya/Sources/Moya/Endpoint.swift create mode 100644 client/Pods/Moya/Sources/Moya/Image.swift create mode 100644 client/Pods/Moya/Sources/Moya/Moya+Alamofire.swift create mode 100644 client/Pods/Moya/Sources/Moya/MoyaError.swift create mode 100644 client/Pods/Moya/Sources/Moya/MoyaProvider+Defaults.swift create mode 100644 client/Pods/Moya/Sources/Moya/MoyaProvider+Internal.swift create mode 100755 client/Pods/Moya/Sources/Moya/MoyaProvider.swift create mode 100644 client/Pods/Moya/Sources/Moya/MultiTarget.swift create mode 100644 client/Pods/Moya/Sources/Moya/MultipartFormData.swift create mode 100644 client/Pods/Moya/Sources/Moya/Plugin.swift create mode 100644 client/Pods/Moya/Sources/Moya/Plugins/AccessTokenPlugin.swift create mode 100644 client/Pods/Moya/Sources/Moya/Plugins/CredentialsPlugin.swift create mode 100644 client/Pods/Moya/Sources/Moya/Plugins/NetworkActivityPlugin.swift create mode 100644 client/Pods/Moya/Sources/Moya/Plugins/NetworkLoggerPlugin.swift create mode 100644 client/Pods/Moya/Sources/Moya/Response.swift create mode 100644 client/Pods/Moya/Sources/Moya/TargetType.swift create mode 100644 client/Pods/Moya/Sources/Moya/Task.swift create mode 100644 client/Pods/Moya/Sources/Moya/URL+Moya.swift create mode 100644 client/Pods/Moya/Sources/Moya/URLRequest+Encoding.swift create mode 100644 client/Pods/Pods.xcodeproj/project.pbxproj create mode 100644 client/Pods/Result/LICENSE create mode 100644 client/Pods/Result/README.md create mode 100644 client/Pods/Result/Result/Result.swift create mode 100644 client/Pods/Result/Result/ResultProtocol.swift create mode 100644 client/Pods/SDWebImage/LICENSE create mode 100644 client/Pods/SDWebImage/README.md create mode 100644 client/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h create mode 100644 client/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m create mode 100644 client/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h create mode 100644 client/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDImageCache.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDImageCache.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageCoder.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageCoder.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageFrame.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageFrame.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageManager.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageManager.m create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h create mode 100644 client/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m create mode 100644 client/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h create mode 100644 client/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m create mode 100644 client/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h create mode 100644 client/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m create mode 100755 client/Pods/SDWebImage/SDWebImage/UIImage+GIF.h create mode 100755 client/Pods/SDWebImage/SDWebImage/UIImage+GIF.m create mode 100644 client/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h create mode 100644 client/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m create mode 100644 client/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h create mode 100644 client/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m create mode 100644 client/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h create mode 100644 client/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m create mode 100644 client/Pods/SDWebImage/SDWebImage/UIView+WebCache.h create mode 100644 client/Pods/SDWebImage/SDWebImage/UIView+WebCache.m create mode 100644 client/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h create mode 100644 client/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m create mode 100644 client/Pods/Target Support Files/Alamofire/Alamofire-dummy.m create mode 100644 client/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch create mode 100644 client/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h create mode 100644 client/Pods/Target Support Files/Alamofire/Alamofire.modulemap create mode 100644 client/Pods/Target Support Files/Alamofire/Alamofire.xcconfig create mode 100644 client/Pods/Target Support Files/Alamofire/Info.plist create mode 100644 client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-dummy.m create mode 100644 client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-prefix.pch create mode 100644 client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-umbrella.h create mode 100644 client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift.modulemap create mode 100644 client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift.xcconfig create mode 100644 client/Pods/Target Support Files/FontAwesome.swift/Info.plist create mode 100644 client/Pods/Target Support Files/FontAwesome.swift/ResourceBundle-FontAwesome.swift-Info.plist create mode 100644 client/Pods/Target Support Files/Moya/Info.plist create mode 100644 client/Pods/Target Support Files/Moya/Moya-dummy.m create mode 100644 client/Pods/Target Support Files/Moya/Moya-prefix.pch create mode 100644 client/Pods/Target Support Files/Moya/Moya-umbrella.h create mode 100644 client/Pods/Target Support Files/Moya/Moya.modulemap create mode 100644 client/Pods/Target Support Files/Moya/Moya.xcconfig create mode 100644 client/Pods/Target Support Files/Pods-CoolCards/Info.plist create mode 100644 client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-acknowledgements.markdown create mode 100644 client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-acknowledgements.plist create mode 100644 client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-dummy.m create mode 100755 client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-frameworks.sh create mode 100755 client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-resources.sh create mode 100644 client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-umbrella.h create mode 100644 client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.debug.xcconfig create mode 100644 client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.modulemap create mode 100644 client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.release.xcconfig create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Info.plist create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-acknowledgements.markdown create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-acknowledgements.plist create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-dummy.m create mode 100755 client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-frameworks.sh create mode 100755 client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-resources.sh create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-umbrella.h create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.debug.xcconfig create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.modulemap create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.release.xcconfig create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsTests/Info.plist create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-acknowledgements.markdown create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-acknowledgements.plist create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-dummy.m create mode 100755 client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-frameworks.sh create mode 100755 client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-resources.sh create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-umbrella.h create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.debug.xcconfig create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.modulemap create mode 100644 client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.release.xcconfig create mode 100644 client/Pods/Target Support Files/Result/Info.plist create mode 100644 client/Pods/Target Support Files/Result/Result-dummy.m create mode 100644 client/Pods/Target Support Files/Result/Result-prefix.pch create mode 100644 client/Pods/Target Support Files/Result/Result-umbrella.h create mode 100644 client/Pods/Target Support Files/Result/Result.modulemap create mode 100644 client/Pods/Target Support Files/Result/Result.xcconfig create mode 100644 client/Pods/Target Support Files/SDWebImage/Info.plist create mode 100644 client/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m create mode 100644 client/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch create mode 100644 client/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h create mode 100644 client/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap create mode 100644 client/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig create mode 100644 server/.dockerignore create mode 100644 server/.gitignore create mode 100644 server/Dockerfile create mode 100755 server/app.py create mode 100755 server/config.py create mode 100755 server/db.py create mode 100755 server/deploy.sh create mode 100644 server/docker-compose.yml create mode 100644 server/examples/card1.json create mode 100644 server/examples/card2.json create mode 100755 server/models.py create mode 100644 server/requirements.txt create mode 100755 server/resources.py diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 00000000..4f405ccc --- /dev/null +++ b/client/.gitignore @@ -0,0 +1 @@ +xcuserdata \ No newline at end of file diff --git a/client/CoolCards.xcodeproj/project.pbxproj b/client/CoolCards.xcodeproj/project.pbxproj new file mode 100644 index 00000000..43a6af53 --- /dev/null +++ b/client/CoolCards.xcodeproj/project.pbxproj @@ -0,0 +1,942 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 33DEB054239F2A45A6B20EE6 /* Pods_CoolCardsTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 496693E06508045040F7BBD2 /* Pods_CoolCardsTests.framework */; }; + A4C7A93FC85D28869A4D0DD9 /* Pods_CoolCards.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7AFE2BE2A9B29FA28364EC59 /* Pods_CoolCards.framework */; }; + B48DBA8730F3B864DD510637 /* Pods_CoolCardsIntegrationTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F9AB3BD82F8BCB55DF50B29 /* Pods_CoolCardsIntegrationTests.framework */; }; + CD31CE321FE73377008748BB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE311FE73377008748BB /* AppDelegate.swift */; }; + CD31CE341FE73377008748BB /* CoolCardsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE331FE73377008748BB /* CoolCardsViewController.swift */; }; + CD31CE371FE73377008748BB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CD31CE351FE73377008748BB /* Main.storyboard */; }; + CD31CE391FE73377008748BB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CD31CE381FE73377008748BB /* Assets.xcassets */; }; + CD31CE3C1FE73377008748BB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CD31CE3A1FE73377008748BB /* LaunchScreen.storyboard */; }; + CD31CE471FE73377008748BB /* CoolCardsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE461FE73377008748BB /* CoolCardsTests.swift */; }; + CD31CE581FE73461008748BB /* CoolCardsIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE571FE73461008748BB /* CoolCardsIntegrationTests.swift */; }; + CD31CE651FE74AC4008748BB /* CoolCardsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE641FE74AC4008748BB /* CoolCardsAPI.swift */; }; + CD31CE681FE750B0008748BB /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE671FE750B0008748BB /* Card.swift */; }; + CD31CE6A1FE7D364008748BB /* CoolCardAPIRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE691FE7D364008748BB /* CoolCardAPIRequest.swift */; }; + CD31CE741FE7E3D5008748BB /* BaseFlowCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE731FE7E3D5008748BB /* BaseFlowCollectionViewController.swift */; }; + CD31CE781FE7E49D008748BB /* CoolCardsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE771FE7E49D008748BB /* CoolCardsViewModel.swift */; }; + CD31CE801FE7E7BB008748BB /* CoolCardsCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE7E1FE7E7BB008748BB /* CoolCardsCollectionViewCell.swift */; }; + CD31CE811FE7E7BB008748BB /* CoolCardsCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD31CE7F1FE7E7BB008748BB /* CoolCardsCollectionViewCell.xib */; }; + CD31CE841FE7E897008748BB /* UIView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE831FE7E897008748BB /* UIView+Extensions.swift */; }; + CD31CE861FE7E8CF008748BB /* UICollectionView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE851FE7E8CF008748BB /* UICollectionView+Extensions.swift */; }; + CD31CE881FE7EABE008748BB /* UIImageView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD31CE871FE7EABE008748BB /* UIImageView+Extensions.swift */; }; + CD3CAE631FE80A6A002B53D2 /* CoolCardsDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD3CAE621FE80A6A002B53D2 /* CoolCardsDetailViewModel.swift */; }; + CD3CAE721FE8162C002B53D2 /* CoolCardsDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD3CAE701FE8162C002B53D2 /* CoolCardsDetailViewController.swift */; }; + CD3CAE731FE8162C002B53D2 /* CoolCardsDetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD3CAE711FE8162C002B53D2 /* CoolCardsDetailViewController.xib */; }; + CD3CAE751FE8263F002B53D2 /* FavoritesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD3CAE741FE8263F002B53D2 /* FavoritesProvider.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + CD31CE431FE73377008748BB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CD31CE261FE73377008748BB /* Project object */; + proxyType = 1; + remoteGlobalIDString = CD31CE2D1FE73377008748BB; + remoteInfo = CoolCards; + }; + CD31CE5A1FE73461008748BB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CD31CE261FE73377008748BB /* Project object */; + proxyType = 1; + remoteGlobalIDString = CD31CE2D1FE73377008748BB; + remoteInfo = CoolCards; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0F9AB3BD82F8BCB55DF50B29 /* Pods_CoolCardsIntegrationTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CoolCardsIntegrationTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 496693E06508045040F7BBD2 /* Pods_CoolCardsTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CoolCardsTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 606513159A8D933437500FAE /* Pods-CoolCardsTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoolCardsTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.debug.xcconfig"; sourceTree = ""; }; + 64F33BC23C651CF8B05B57C1 /* Pods-CoolCards.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoolCards.release.xcconfig"; path = "Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.release.xcconfig"; sourceTree = ""; }; + 69F28CB427824E0A14F2C526 /* Pods-CoolCardsTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoolCardsTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.release.xcconfig"; sourceTree = ""; }; + 7AFE2BE2A9B29FA28364EC59 /* Pods_CoolCards.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CoolCards.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A946D1D6CD979BDE9AC5B987 /* Pods-CoolCardsIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoolCardsIntegrationTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.debug.xcconfig"; sourceTree = ""; }; + B6FF43D8E279DAD47C322C11 /* Pods-CoolCardsIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoolCardsIntegrationTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.release.xcconfig"; sourceTree = ""; }; + C3877B914B75742D7B94A243 /* Pods-CoolCards.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoolCards.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.debug.xcconfig"; sourceTree = ""; }; + CD31CE2E1FE73377008748BB /* CoolCards.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CoolCards.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CD31CE311FE73377008748BB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + CD31CE331FE73377008748BB /* CoolCardsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoolCardsViewController.swift; sourceTree = ""; }; + CD31CE361FE73377008748BB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + CD31CE381FE73377008748BB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + CD31CE3B1FE73377008748BB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + CD31CE3D1FE73377008748BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CD31CE421FE73377008748BB /* CoolCardsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoolCardsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + CD31CE461FE73377008748BB /* CoolCardsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoolCardsTests.swift; sourceTree = ""; }; + CD31CE481FE73377008748BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CD31CE551FE73461008748BB /* CoolCardsIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoolCardsIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + CD31CE571FE73461008748BB /* CoolCardsIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoolCardsIntegrationTests.swift; sourceTree = ""; }; + CD31CE591FE73461008748BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CD31CE641FE74AC4008748BB /* CoolCardsAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoolCardsAPI.swift; sourceTree = ""; }; + CD31CE671FE750B0008748BB /* Card.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Card.swift; sourceTree = ""; }; + CD31CE691FE7D364008748BB /* CoolCardAPIRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoolCardAPIRequest.swift; sourceTree = ""; }; + CD31CE731FE7E3D5008748BB /* BaseFlowCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseFlowCollectionViewController.swift; sourceTree = ""; }; + CD31CE771FE7E49D008748BB /* CoolCardsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoolCardsViewModel.swift; sourceTree = ""; }; + CD31CE7E1FE7E7BB008748BB /* CoolCardsCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoolCardsCollectionViewCell.swift; sourceTree = ""; }; + CD31CE7F1FE7E7BB008748BB /* CoolCardsCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CoolCardsCollectionViewCell.xib; sourceTree = ""; }; + CD31CE831FE7E897008748BB /* UIView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extensions.swift"; sourceTree = ""; }; + CD31CE851FE7E8CF008748BB /* UICollectionView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UICollectionView+Extensions.swift"; sourceTree = ""; }; + CD31CE871FE7EABE008748BB /* UIImageView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImageView+Extensions.swift"; sourceTree = ""; }; + CD3CAE621FE80A6A002B53D2 /* CoolCardsDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoolCardsDetailViewModel.swift; sourceTree = ""; }; + CD3CAE701FE8162C002B53D2 /* CoolCardsDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoolCardsDetailViewController.swift; sourceTree = ""; }; + CD3CAE711FE8162C002B53D2 /* CoolCardsDetailViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CoolCardsDetailViewController.xib; sourceTree = ""; }; + CD3CAE741FE8263F002B53D2 /* FavoritesProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavoritesProvider.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CD31CE2B1FE73377008748BB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A4C7A93FC85D28869A4D0DD9 /* Pods_CoolCards.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD31CE3F1FE73377008748BB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 33DEB054239F2A45A6B20EE6 /* Pods_CoolCardsTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD31CE521FE73461008748BB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B48DBA8730F3B864DD510637 /* Pods_CoolCardsIntegrationTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 4620D0E4E46EF22F2262893B /* Pods */ = { + isa = PBXGroup; + children = ( + C3877B914B75742D7B94A243 /* Pods-CoolCards.debug.xcconfig */, + 64F33BC23C651CF8B05B57C1 /* Pods-CoolCards.release.xcconfig */, + A946D1D6CD979BDE9AC5B987 /* Pods-CoolCardsIntegrationTests.debug.xcconfig */, + B6FF43D8E279DAD47C322C11 /* Pods-CoolCardsIntegrationTests.release.xcconfig */, + 606513159A8D933437500FAE /* Pods-CoolCardsTests.debug.xcconfig */, + 69F28CB427824E0A14F2C526 /* Pods-CoolCardsTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 54910C098E905AAA9B3AFB88 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7AFE2BE2A9B29FA28364EC59 /* Pods_CoolCards.framework */, + 0F9AB3BD82F8BCB55DF50B29 /* Pods_CoolCardsIntegrationTests.framework */, + 496693E06508045040F7BBD2 /* Pods_CoolCardsTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CD31CE251FE73377008748BB = { + isa = PBXGroup; + children = ( + CD31CE301FE73377008748BB /* CoolCards */, + CD31CE451FE73377008748BB /* CoolCardsTests */, + CD31CE561FE73461008748BB /* CoolCardsIntegrationTests */, + CD31CE2F1FE73377008748BB /* Products */, + 4620D0E4E46EF22F2262893B /* Pods */, + 54910C098E905AAA9B3AFB88 /* Frameworks */, + ); + sourceTree = ""; + }; + CD31CE2F1FE73377008748BB /* Products */ = { + isa = PBXGroup; + children = ( + CD31CE2E1FE73377008748BB /* CoolCards.app */, + CD31CE421FE73377008748BB /* CoolCardsTests.xctest */, + CD31CE551FE73461008748BB /* CoolCardsIntegrationTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + CD31CE301FE73377008748BB /* CoolCards */ = { + isa = PBXGroup; + children = ( + CD31CE311FE73377008748BB /* AppDelegate.swift */, + CD31CE751FE7E463008748BB /* UI */, + CD31CE701FE7DA0A008748BB /* Resources */, + CD31CE631FE74AA6008748BB /* CoolCardsAPI */, + CD31CE6C1FE7D6F1008748BB /* Suporting Files */, + CD31CE3D1FE73377008748BB /* Info.plist */, + ); + path = CoolCards; + sourceTree = ""; + }; + CD31CE451FE73377008748BB /* CoolCardsTests */ = { + isa = PBXGroup; + children = ( + CD31CE461FE73377008748BB /* CoolCardsTests.swift */, + CD31CE481FE73377008748BB /* Info.plist */, + ); + path = CoolCardsTests; + sourceTree = ""; + }; + CD31CE561FE73461008748BB /* CoolCardsIntegrationTests */ = { + isa = PBXGroup; + children = ( + CD31CE571FE73461008748BB /* CoolCardsIntegrationTests.swift */, + CD31CE591FE73461008748BB /* Info.plist */, + ); + path = CoolCardsIntegrationTests; + sourceTree = ""; + }; + CD31CE631FE74AA6008748BB /* CoolCardsAPI */ = { + isa = PBXGroup; + children = ( + CD31CE641FE74AC4008748BB /* CoolCardsAPI.swift */, + CD31CE691FE7D364008748BB /* CoolCardAPIRequest.swift */, + CD31CE661FE7508A008748BB /* DataEntities */, + ); + path = CoolCardsAPI; + sourceTree = ""; + }; + CD31CE661FE7508A008748BB /* DataEntities */ = { + isa = PBXGroup; + children = ( + CD31CE671FE750B0008748BB /* Card.swift */, + ); + path = DataEntities; + sourceTree = ""; + }; + CD31CE6B1FE7D6D4008748BB /* Storyboards */ = { + isa = PBXGroup; + children = ( + CD31CE351FE73377008748BB /* Main.storyboard */, + CD31CE3A1FE73377008748BB /* LaunchScreen.storyboard */, + ); + path = Storyboards; + sourceTree = ""; + }; + CD31CE6C1FE7D6F1008748BB /* Suporting Files */ = { + isa = PBXGroup; + children = ( + ); + path = "Suporting Files"; + sourceTree = ""; + }; + CD31CE6E1FE7D9CE008748BB /* CoolCardsViewController */ = { + isa = PBXGroup; + children = ( + CD31CE331FE73377008748BB /* CoolCardsViewController.swift */, + CD31CE771FE7E49D008748BB /* CoolCardsViewModel.swift */, + CD31CE791FE7E652008748BB /* CoolCardsCollectionViewCell */, + ); + path = CoolCardsViewController; + sourceTree = ""; + }; + CD31CE6F1FE7D9DE008748BB /* CoolCardsDetailViewController */ = { + isa = PBXGroup; + children = ( + CD3CAE701FE8162C002B53D2 /* CoolCardsDetailViewController.swift */, + CD3CAE711FE8162C002B53D2 /* CoolCardsDetailViewController.xib */, + CD3CAE621FE80A6A002B53D2 /* CoolCardsDetailViewModel.swift */, + CD3CAE741FE8263F002B53D2 /* FavoritesProvider.swift */, + ); + path = CoolCardsDetailViewController; + sourceTree = ""; + }; + CD31CE701FE7DA0A008748BB /* Resources */ = { + isa = PBXGroup; + children = ( + CD31CE381FE73377008748BB /* Assets.xcassets */, + ); + path = Resources; + sourceTree = ""; + }; + CD31CE721FE7E3B7008748BB /* BaseFlowCollectionViewController */ = { + isa = PBXGroup; + children = ( + CD31CE731FE7E3D5008748BB /* BaseFlowCollectionViewController.swift */, + ); + path = BaseFlowCollectionViewController; + sourceTree = ""; + }; + CD31CE751FE7E463008748BB /* UI */ = { + isa = PBXGroup; + children = ( + CD31CE6B1FE7D6D4008748BB /* Storyboards */, + CD31CE721FE7E3B7008748BB /* BaseFlowCollectionViewController */, + CD31CE6E1FE7D9CE008748BB /* CoolCardsViewController */, + CD31CE6F1FE7D9DE008748BB /* CoolCardsDetailViewController */, + CD31CE821FE7E809008748BB /* Extension */, + ); + path = UI; + sourceTree = ""; + }; + CD31CE791FE7E652008748BB /* CoolCardsCollectionViewCell */ = { + isa = PBXGroup; + children = ( + CD31CE7E1FE7E7BB008748BB /* CoolCardsCollectionViewCell.swift */, + CD31CE7F1FE7E7BB008748BB /* CoolCardsCollectionViewCell.xib */, + ); + path = CoolCardsCollectionViewCell; + sourceTree = ""; + }; + CD31CE821FE7E809008748BB /* Extension */ = { + isa = PBXGroup; + children = ( + CD31CE831FE7E897008748BB /* UIView+Extensions.swift */, + CD31CE851FE7E8CF008748BB /* UICollectionView+Extensions.swift */, + CD31CE871FE7EABE008748BB /* UIImageView+Extensions.swift */, + ); + path = Extension; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CD31CE2D1FE73377008748BB /* CoolCards */ = { + isa = PBXNativeTarget; + buildConfigurationList = CD31CE4B1FE73377008748BB /* Build configuration list for PBXNativeTarget "CoolCards" */; + buildPhases = ( + 3CF1E9609FE3E78E5887DE92 /* [CP] Check Pods Manifest.lock */, + CD31CE2A1FE73377008748BB /* Sources */, + CD31CE2B1FE73377008748BB /* Frameworks */, + CD31CE2C1FE73377008748BB /* Resources */, + 11EF348550C63DDFC75F44E1 /* [CP] Embed Pods Frameworks */, + 61589AD07BDA68A11B46DC64 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CoolCards; + productName = CoolCards; + productReference = CD31CE2E1FE73377008748BB /* CoolCards.app */; + productType = "com.apple.product-type.application"; + }; + CD31CE411FE73377008748BB /* CoolCardsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = CD31CE4E1FE73377008748BB /* Build configuration list for PBXNativeTarget "CoolCardsTests" */; + buildPhases = ( + 4E413E2ED9629D81578F351E /* [CP] Check Pods Manifest.lock */, + CD31CE3E1FE73377008748BB /* Sources */, + CD31CE3F1FE73377008748BB /* Frameworks */, + CD31CE401FE73377008748BB /* Resources */, + BF47530E8C88B98F91E22304 /* [CP] Embed Pods Frameworks */, + 17A1771A32F931B8214BA9E3 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + CD31CE441FE73377008748BB /* PBXTargetDependency */, + ); + name = CoolCardsTests; + productName = CoolCardsTests; + productReference = CD31CE421FE73377008748BB /* CoolCardsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + CD31CE541FE73461008748BB /* CoolCardsIntegrationTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = CD31CE5E1FE73461008748BB /* Build configuration list for PBXNativeTarget "CoolCardsIntegrationTests" */; + buildPhases = ( + BC285006D1E3636D8B20CE4E /* [CP] Check Pods Manifest.lock */, + CD31CE511FE73461008748BB /* Sources */, + CD31CE521FE73461008748BB /* Frameworks */, + CD31CE531FE73461008748BB /* Resources */, + 5EED6232B7289B1DC6F82310 /* [CP] Embed Pods Frameworks */, + 25C248E72BD821E65F45FA68 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + CD31CE5B1FE73461008748BB /* PBXTargetDependency */, + ); + name = CoolCardsIntegrationTests; + productName = CoolCardsIntegrationTests; + productReference = CD31CE551FE73461008748BB /* CoolCardsIntegrationTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CD31CE261FE73377008748BB /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = "Chatterjee, Sumeru"; + TargetAttributes = { + CD31CE2D1FE73377008748BB = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + CD31CE411FE73377008748BB = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + TestTargetID = CD31CE2D1FE73377008748BB; + }; + CD31CE541FE73461008748BB = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + TestTargetID = CD31CE2D1FE73377008748BB; + }; + }; + }; + buildConfigurationList = CD31CE291FE73377008748BB /* Build configuration list for PBXProject "CoolCards" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = CD31CE251FE73377008748BB; + productRefGroup = CD31CE2F1FE73377008748BB /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CD31CE2D1FE73377008748BB /* CoolCards */, + CD31CE411FE73377008748BB /* CoolCardsTests */, + CD31CE541FE73461008748BB /* CoolCardsIntegrationTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CD31CE2C1FE73377008748BB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD31CE3C1FE73377008748BB /* LaunchScreen.storyboard in Resources */, + CD31CE811FE7E7BB008748BB /* CoolCardsCollectionViewCell.xib in Resources */, + CD3CAE731FE8162C002B53D2 /* CoolCardsDetailViewController.xib in Resources */, + CD31CE391FE73377008748BB /* Assets.xcassets in Resources */, + CD31CE371FE73377008748BB /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD31CE401FE73377008748BB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD31CE531FE73461008748BB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 11EF348550C63DDFC75F44E1 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/FontAwesome.swift/FontAwesome_swift.framework", + "${BUILT_PRODUCTS_DIR}/Moya/Moya.framework", + "${BUILT_PRODUCTS_DIR}/Result/Result.framework", + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FontAwesome_swift.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Moya.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Result.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 17A1771A32F931B8214BA9E3 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 25C248E72BD821E65F45FA68 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 3CF1E9609FE3E78E5887DE92 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-CoolCards-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 4E413E2ED9629D81578F351E /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-CoolCardsTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 5EED6232B7289B1DC6F82310 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/FontAwesome.swift/FontAwesome_swift.framework", + "${BUILT_PRODUCTS_DIR}/Moya/Moya.framework", + "${BUILT_PRODUCTS_DIR}/Result/Result.framework", + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FontAwesome_swift.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Moya.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Result.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 61589AD07BDA68A11B46DC64 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + BC285006D1E3636D8B20CE4E /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-CoolCardsIntegrationTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + BF47530E8C88B98F91E22304 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/FontAwesome.swift/FontAwesome_swift.framework", + "${BUILT_PRODUCTS_DIR}/Moya/Moya.framework", + "${BUILT_PRODUCTS_DIR}/Result/Result.framework", + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FontAwesome_swift.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Moya.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Result.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CD31CE2A1FE73377008748BB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD31CE651FE74AC4008748BB /* CoolCardsAPI.swift in Sources */, + CD31CE781FE7E49D008748BB /* CoolCardsViewModel.swift in Sources */, + CD31CE881FE7EABE008748BB /* UIImageView+Extensions.swift in Sources */, + CD31CE861FE7E8CF008748BB /* UICollectionView+Extensions.swift in Sources */, + CD31CE341FE73377008748BB /* CoolCardsViewController.swift in Sources */, + CD31CE841FE7E897008748BB /* UIView+Extensions.swift in Sources */, + CD3CAE751FE8263F002B53D2 /* FavoritesProvider.swift in Sources */, + CD31CE681FE750B0008748BB /* Card.swift in Sources */, + CD3CAE721FE8162C002B53D2 /* CoolCardsDetailViewController.swift in Sources */, + CD31CE741FE7E3D5008748BB /* BaseFlowCollectionViewController.swift in Sources */, + CD3CAE631FE80A6A002B53D2 /* CoolCardsDetailViewModel.swift in Sources */, + CD31CE321FE73377008748BB /* AppDelegate.swift in Sources */, + CD31CE6A1FE7D364008748BB /* CoolCardAPIRequest.swift in Sources */, + CD31CE801FE7E7BB008748BB /* CoolCardsCollectionViewCell.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD31CE3E1FE73377008748BB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD31CE471FE73377008748BB /* CoolCardsTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD31CE511FE73461008748BB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD31CE581FE73461008748BB /* CoolCardsIntegrationTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + CD31CE441FE73377008748BB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CD31CE2D1FE73377008748BB /* CoolCards */; + targetProxy = CD31CE431FE73377008748BB /* PBXContainerItemProxy */; + }; + CD31CE5B1FE73461008748BB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CD31CE2D1FE73377008748BB /* CoolCards */; + targetProxy = CD31CE5A1FE73461008748BB /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + CD31CE351FE73377008748BB /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CD31CE361FE73377008748BB /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + CD31CE3A1FE73377008748BB /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CD31CE3B1FE73377008748BB /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CD31CE491FE73377008748BB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + CD31CE4A1FE73377008748BB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CD31CE4C1FE73377008748BB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3877B914B75742D7B94A243 /* Pods-CoolCards.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = WBF45A68AX; + INFOPLIST_FILE = CoolCards/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.nodemaker.CoolCards; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CD31CE4D1FE73377008748BB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 64F33BC23C651CF8B05B57C1 /* Pods-CoolCards.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = WBF45A68AX; + INFOPLIST_FILE = CoolCards/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.nodemaker.CoolCards; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + CD31CE4F1FE73377008748BB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 606513159A8D933437500FAE /* Pods-CoolCardsTests.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = WBF45A68AX; + INFOPLIST_FILE = CoolCardsTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.nodemaker.CoolCardsTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CoolCards.app/CoolCards"; + }; + name = Debug; + }; + CD31CE501FE73377008748BB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 69F28CB427824E0A14F2C526 /* Pods-CoolCardsTests.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = WBF45A68AX; + INFOPLIST_FILE = CoolCardsTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.nodemaker.CoolCardsTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CoolCards.app/CoolCards"; + }; + name = Release; + }; + CD31CE5C1FE73461008748BB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A946D1D6CD979BDE9AC5B987 /* Pods-CoolCardsIntegrationTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = WBF45A68AX; + INFOPLIST_FILE = CoolCardsIntegrationTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.nodemaker.CoolCardsIntegrationTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CoolCards.app/CoolCards"; + }; + name = Debug; + }; + CD31CE5D1FE73461008748BB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B6FF43D8E279DAD47C322C11 /* Pods-CoolCardsIntegrationTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = WBF45A68AX; + INFOPLIST_FILE = CoolCardsIntegrationTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.nodemaker.CoolCardsIntegrationTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CoolCards.app/CoolCards"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CD31CE291FE73377008748BB /* Build configuration list for PBXProject "CoolCards" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD31CE491FE73377008748BB /* Debug */, + CD31CE4A1FE73377008748BB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CD31CE4B1FE73377008748BB /* Build configuration list for PBXNativeTarget "CoolCards" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD31CE4C1FE73377008748BB /* Debug */, + CD31CE4D1FE73377008748BB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CD31CE4E1FE73377008748BB /* Build configuration list for PBXNativeTarget "CoolCardsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD31CE4F1FE73377008748BB /* Debug */, + CD31CE501FE73377008748BB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CD31CE5E1FE73461008748BB /* Build configuration list for PBXNativeTarget "CoolCardsIntegrationTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD31CE5C1FE73461008748BB /* Debug */, + CD31CE5D1FE73461008748BB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CD31CE261FE73377008748BB /* Project object */; +} diff --git a/client/CoolCards.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/client/CoolCards.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..2f341402 --- /dev/null +++ b/client/CoolCards.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/client/CoolCards.xcworkspace/contents.xcworkspacedata b/client/CoolCards.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..f6750a0b --- /dev/null +++ b/client/CoolCards.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/client/CoolCards/AppDelegate.swift b/client/CoolCards/AppDelegate.swift new file mode 100644 index 00000000..7c880bcc --- /dev/null +++ b/client/CoolCards/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // 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. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/client/CoolCards/CoolCardsAPI/CoolCardAPIRequest.swift b/client/CoolCards/CoolCardsAPI/CoolCardAPIRequest.swift new file mode 100644 index 00000000..644fcf89 --- /dev/null +++ b/client/CoolCards/CoolCardsAPI/CoolCardAPIRequest.swift @@ -0,0 +1,55 @@ +// +// CoolCardAPIRequest.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import Foundation +import Moya + +enum CoolCardsAPIRequest { + case cards + case card(cardId: String) +} + +extension CoolCardsAPIRequest: TargetType { + + var baseURL: URL { + return URL(string: "http://35.205.213.172:5000")! + } + + var headers: [String : String]? { + return nil + } + + var path: String { + switch self { + case .cards: + return "/cards" + case .card(let cardId): + return "/card/\(cardId)" + } + } + + var method: Moya.Method { + return .get + } + + var parameterEncoding: ParameterEncoding { + return JSONEncoding.default + } + + var parameters: [String: Any]? { + return nil + } + + var sampleData: Data { + return Data() + } + + var task: Moya.Task { + return .requestPlain + } +} diff --git a/client/CoolCards/CoolCardsAPI/CoolCardsAPI.swift b/client/CoolCards/CoolCardsAPI/CoolCardsAPI.swift new file mode 100644 index 00000000..228dc5a0 --- /dev/null +++ b/client/CoolCards/CoolCardsAPI/CoolCardsAPI.swift @@ -0,0 +1,50 @@ +// +// CoolCardsAPI.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import Foundation +import Moya + +class CoolCardsAPI { + static let provider = MoyaProvider() + + static func getCards(completion: @escaping (([Card]?, Error?) -> Void)) { + provider.request(.cards) { result in + switch result { + case let .success(response): + do { + let results = try JSONDecoder().decode([Card].self, from: response.data) + completion(results, nil) + } catch let exception { + print (exception) + completion(nil, exception) + } + case let .failure(error): + print (error) + completion(nil, error) + } + } + } + + static func getCard(cardId: String, completion: @escaping ((Card?, Error?) -> Void)) { + provider.request(.card(cardId: cardId)) { result in + switch result { + case let .success(response): + do { + let results = try JSONDecoder().decode(Card.self, from: response.data) + completion(results, nil) + } catch let exception { + print (exception) + completion(nil, exception) + } + case let .failure(error): + print (error) + completion(nil, error) + } + } + } +} diff --git a/client/CoolCards/CoolCardsAPI/DataEntities/Card.swift b/client/CoolCards/CoolCardsAPI/DataEntities/Card.swift new file mode 100644 index 00000000..94de06c4 --- /dev/null +++ b/client/CoolCards/CoolCardsAPI/DataEntities/Card.swift @@ -0,0 +1,53 @@ +// +// Card.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +struct Card: Decodable { + let cardId : String + let name: String + let cardSet: String + let type: String + let rarity: String + let cost: Int + let attack: Int + let health: Int + let text: String + let flavor: String + let artist: String + let collectible: Bool + let elite: Bool + let playerClass: String + let multiClassGroup: String? + let howToGet: String? + let howToGetGold: String? + let img: String + let imgGold: String + let locale: String + + private enum CodingKeys: String, CodingKey { + case cardId = "cardId" + case name = "name" + case cardSet = "cardSet" + case type = "type" + case rarity = "rarity" + case cost = "cost" + case attack = "attack" + case health = "health" + case text = "text" + case flavor = "flavor" + case artist = "artist" + case collectible = "collectible" + case elite = "elite" + case playerClass = "playerClass" + case multiClassGroup = "multiClassGroup" + case howToGet = "howToGet" + case howToGetGold = "howToGetGold" + case img = "img" + case imgGold = "imgGold" + case locale = "locale" + } +} diff --git a/client/CoolCards/Info.plist b/client/CoolCards/Info.plist new file mode 100644 index 00000000..4fbf58cd --- /dev/null +++ b/client/CoolCards/Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSAppTransportSecurity + + + NSAllowsArbitraryLoads + + + + diff --git a/client/CoolCards/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/client/CoolCards/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/client/CoolCards/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/client/CoolCards/UI/BaseFlowCollectionViewController/BaseFlowCollectionViewController.swift b/client/CoolCards/UI/BaseFlowCollectionViewController/BaseFlowCollectionViewController.swift new file mode 100644 index 00000000..650ac4b6 --- /dev/null +++ b/client/CoolCards/UI/BaseFlowCollectionViewController/BaseFlowCollectionViewController.swift @@ -0,0 +1,64 @@ +// +// BaseFlowCollectionViewController.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import UIKit + +let kImagePosterRatio: CGFloat = (2.0 / 3.0) + +public class BaseFlowCollectionViewController: UIViewController { + + @IBOutlet weak var collectionView: UICollectionView! + + public override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.collectionViewItemsPerRow = self.itemsPerRow(for: UIScreen.main.bounds.size) + } + + public override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { + super.viewWillTransition(to: size, with: coordinator) + guard self.isViewLoaded else { return } + self.collectionViewItemsPerRow = self.itemsPerRow(for: size) + self.collectionView.collectionViewLayout.invalidateLayout() + } + + fileprivate func itemsPerRow(for size: CGSize) -> Int { + if size.width > 768 { return 4 } + else if size.width > 414 { return 3 } + else { return 2 } + } + + fileprivate var collectionViewItemsPerRow: Int = 2 + fileprivate let collectionViewMargin: CGFloat = 15.0 + fileprivate let collectionViewItemSizeRatio: CGFloat = kImagePosterRatio + fileprivate var collectionViewItemWidth: CGFloat { + return (self.collectionView.bounds.width - (CGFloat(self.collectionViewItemsPerRow + 1) * self.collectionViewMargin)) / CGFloat(self.collectionViewItemsPerRow) + } + fileprivate var collectionViewItemHeight: CGFloat { + return self.collectionViewItemWidth / self.collectionViewItemSizeRatio + } +} + +extension BaseFlowCollectionViewController: UICollectionViewDelegateFlowLayout { + + public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + collectionView.deselectItem(at: indexPath, animated: true) + } + + public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + return CGSize(width: self.collectionViewItemWidth, height: self.collectionViewItemHeight) + } + + public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { + return UIEdgeInsets(top: self.collectionViewMargin, left: self.collectionViewMargin, bottom: self.collectionViewMargin, right: self.collectionViewMargin) + } + + public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { + return self.collectionViewMargin + } +} + diff --git a/client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewController.swift b/client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewController.swift new file mode 100644 index 00000000..68ffcd57 --- /dev/null +++ b/client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewController.swift @@ -0,0 +1,83 @@ +// +// CoolCardsDetailViewController.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import UIKit +import FontAwesome_swift + +class CoolCardsDetailViewController: UIViewController { + @IBOutlet weak var cardImageView: UIImageView! + @IBOutlet weak var cardTitleLabel: UILabel! + @IBOutlet weak var cardDescriptionLabel: UILabel! + + public var cardId: String? = nil + fileprivate let viewModel: CoolCardsDetailViewModel = CoolCardsDetailViewModel() + fileprivate var favoriteButtonItem: UIBarButtonItem? + + override func viewDidLoad() { + super.viewDidLoad() + self.setupUI() + self.setupBindings() + if let cardId = self.cardId { + self.viewModel.load(cardId: cardId) + } + } + + fileprivate func setupUI() { + self.view.backgroundColor = UIColor.white + if let cardId = self.cardId { + let titleFormat = NSLocalizedString("Card %@", comment:"Format for detail view controller title") + self.title = String(format: titleFormat, cardId) + } + self.cardDescriptionLabel.numberOfLines = 0 + self.setupFavoriteButton() + } + + func setupFavoriteButton() { + if let cardId = self.cardId { + let isFavorite = FavoritesProvider.getFavorite(cardId: cardId) + let icon = isFavorite ? String.fontAwesomeIcon(name: .heart) : String.fontAwesomeIcon(name: .heartO) + let favoriteButtonItem = UIBarButtonItem(title: icon, style: UIBarButtonItemStyle.plain, target: self, action: #selector(CoolCardsDetailViewController.toggleFavorite)) + let attributes = [NSAttributedStringKey.font: UIFont.fontAwesome(ofSize: 25)] as [NSAttributedStringKey: Any] + favoriteButtonItem.setTitleTextAttributes(attributes, for: .normal) + favoriteButtonItem.setTitleTextAttributes(attributes, for: .highlighted) + + self.favoriteButtonItem = favoriteButtonItem + self.navigationItem.rightBarButtonItem = favoriteButtonItem + } + } + + @objc fileprivate func toggleFavorite() { + if let cardId = self.cardId { + let isFavorite = FavoritesProvider.getFavorite(cardId: cardId) + FavoritesProvider.setFavorite(cardId: cardId, favorite: !isFavorite) + self.setupFavoriteButton() + } + } + + fileprivate func setupBindings() { + self.viewModel.delegate = self + } + + fileprivate func configureViewWithCard(card: Card) { + self.cardImageView.setImage(imageURL: URL(string:card.imgGold)) + self.cardTitleLabel.text = card.name + self.cardDescriptionLabel.text = card.flavor + } +} + +extension CoolCardsDetailViewController : CoolCardsDetailViewModelDelegate { + func didLoadModel() { + if let card = self.viewModel.card { + self.configureViewWithCard(card: card) + } + } + + func didFailModelLoadWithError() { + + } +} diff --git a/client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewController.xib b/client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewController.xib new file mode 100644 index 00000000..78099a85 --- /dev/null +++ b/client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewController.xib @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewModel.swift b/client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewModel.swift new file mode 100644 index 00000000..97c2aa00 --- /dev/null +++ b/client/CoolCards/UI/CoolCardsDetailViewController/CoolCardsDetailViewModel.swift @@ -0,0 +1,29 @@ +// +// CoolCardsDetailViewModel.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import Foundation + +final class CoolCardsDetailViewModel: NSObject { + public var delegate:CoolCardsDetailViewModelDelegate? + public var card:Card? + public func load(cardId: String) { + CoolCardsAPI.getCard(cardId:cardId, completion: { card, error in + self.card = card + if error == nil { + self.delegate?.didLoadModel() + } else { + self.delegate?.didFailModelLoadWithError() + } + }) + } +} + +protocol CoolCardsDetailViewModelDelegate: class { + func didLoadModel() + func didFailModelLoadWithError() +} diff --git a/client/CoolCards/UI/CoolCardsDetailViewController/FavoritesProvider.swift b/client/CoolCards/UI/CoolCardsDetailViewController/FavoritesProvider.swift new file mode 100644 index 00000000..d946bde9 --- /dev/null +++ b/client/CoolCards/UI/CoolCardsDetailViewController/FavoritesProvider.swift @@ -0,0 +1,34 @@ +// +// FavoritesProvider.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import Foundation + +class FavoritesProvider { + private static let favoritesKey = "com.coolcards.favorites" + + public static func setFavorite(cardId: String, favorite: Bool) { + if var favorites = UserDefaults.standard.value(forKey: favoritesKey) as? [String] { + if (favorite && !favorites.contains(cardId)) { + favorites.append(cardId) + } else if (!favorite && favorites.contains(cardId)) { + favorites = favorites.filter({ $0 != cardId }) + } + UserDefaults.standard.set(favorites, forKey: favoritesKey) + } else { + UserDefaults.standard.set([cardId], forKey: favoritesKey) + } + UserDefaults.standard.synchronize() + } + + public static func getFavorite(cardId: String) -> Bool { + if let favorites = UserDefaults.standard.value(forKey: favoritesKey) as? [String] { + return favorites.contains(cardId) + } + return false + } +} diff --git a/client/CoolCards/UI/CoolCardsViewController/CoolCardsCollectionViewCell/CoolCardsCollectionViewCell.swift b/client/CoolCards/UI/CoolCardsViewController/CoolCardsCollectionViewCell/CoolCardsCollectionViewCell.swift new file mode 100644 index 00000000..0b97aead --- /dev/null +++ b/client/CoolCards/UI/CoolCardsViewController/CoolCardsCollectionViewCell/CoolCardsCollectionViewCell.swift @@ -0,0 +1,34 @@ +// +// CoolCardsCollectionViewCell.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import UIKit + +class CoolCardsCollectionViewCell: UICollectionViewCell { + public var didTap: ((CoolCardsCollectionViewCell) -> Void)? + + @IBOutlet weak var cardImageView: UIImageView! + + override public func awakeFromNib() { + super.awakeFromNib() + self.backgroundColor = UIColor(white: 0.0, alpha: 0.15) + let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(CoolCardsCollectionViewCell.tap(_:))) + self.addGestureRecognizer(gestureRecognizer) + } + + func populate(imageURL: URL?, title: String, description: String) { + self.cardImageView.setImage(imageURL: imageURL, animatedOnce: true) + } + + @objc private func tap(_ sender: Any) { + self.didTap?(self) + } +} + +extension CoolCardsCollectionViewCell: NibLoadableView { } + +extension CoolCardsCollectionViewCell: ReusableView { } diff --git a/client/CoolCards/UI/CoolCardsViewController/CoolCardsCollectionViewCell/CoolCardsCollectionViewCell.xib b/client/CoolCards/UI/CoolCardsViewController/CoolCardsCollectionViewCell/CoolCardsCollectionViewCell.xib new file mode 100644 index 00000000..31333e65 --- /dev/null +++ b/client/CoolCards/UI/CoolCardsViewController/CoolCardsCollectionViewCell/CoolCardsCollectionViewCell.xib @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/CoolCards/UI/CoolCardsViewController/CoolCardsViewController.swift b/client/CoolCards/UI/CoolCardsViewController/CoolCardsViewController.swift new file mode 100644 index 00000000..46ead76f --- /dev/null +++ b/client/CoolCards/UI/CoolCardsViewController/CoolCardsViewController.swift @@ -0,0 +1,81 @@ +// +// CoolCardsViewController.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import UIKit + +class CoolCardsViewController: BaseFlowCollectionViewController { + + fileprivate let refreshControl: UIRefreshControl = UIRefreshControl() + fileprivate let viewModel: CoolCardsViewModel = CoolCardsViewModel() + + override func viewDidLoad() { + super.viewDidLoad() + self.setupUI() + self.setupCollectionView() + self.setupBindings() + self.refresh() + } + + fileprivate func setupUI() { + self.title = NSLocalizedString("Cards", comment: "Cards View Controller Title") + } + + fileprivate func setupCollectionView() { + self.collectionView.addSubview(self.refreshControl) + self.collectionView.registerReusableCell(CoolCardsCollectionViewCell.self) + self.collectionView.delegate = self + self.collectionView.dataSource = self + } + + fileprivate func setupBindings() { + self.viewModel.delegate = self + self.refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged) + } + + @objc fileprivate func refresh() { + self.viewModel.load() + } +} + +extension CoolCardsViewController: UICollectionViewDataSource { + public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + if let cards = viewModel.cards { + return cards.count + } else { + return 0 + } + } + + open func collectionView(_ collectionView: UICollectionView, + cellForItemAt indexPath: IndexPath) -> UICollectionViewCell + { + guard let cell = self.collectionView.dequeueReusableCell(withReuseIdentifier: CoolCardsCollectionViewCell.DefaultReuseIdentifier, for: indexPath) as? CoolCardsCollectionViewCell else { + fatalError("Could not dequeue cell with identifier: \(CoolCardsCollectionViewCell.DefaultReuseIdentifier)") + } + + if let card = self.viewModel.cards?[indexPath.row] { + cell.populate(imageURL: URL(string: card.img), title: card.name, description: card.type) + cell.didTap = { [weak self] cell in + let viewController = CoolCardsDetailViewController(nibName: "CoolCardsDetailViewController", bundle: nil) + viewController.cardId = card.cardId + self?.navigationController?.pushViewController(viewController, animated: true) + } + } + return cell + } +} + +extension CoolCardsViewController : CoolCardsViewModelDelegate { + func didLoadModel() { + self.collectionView.reloadData() + } + + func didFailModelLoadWithError() { + + } +} diff --git a/client/CoolCards/UI/CoolCardsViewController/CoolCardsViewModel.swift b/client/CoolCards/UI/CoolCardsViewController/CoolCardsViewModel.swift new file mode 100644 index 00000000..06e35fc9 --- /dev/null +++ b/client/CoolCards/UI/CoolCardsViewController/CoolCardsViewModel.swift @@ -0,0 +1,29 @@ +// +// CoolCardsViewModel.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import Foundation + +final class CoolCardsViewModel: NSObject { + public var delegate:CoolCardsViewModelDelegate? + public var cards:[Card]? + public func load() { + CoolCardsAPI.getCards(completion: { cards, error in + self.cards = cards + if error == nil { + self.delegate?.didLoadModel() + } else { + self.delegate?.didFailModelLoadWithError() + } + }) + } +} + +protocol CoolCardsViewModelDelegate: class { + func didLoadModel() + func didFailModelLoadWithError() +} diff --git a/client/CoolCards/UI/Extension/UICollectionView+Extensions.swift b/client/CoolCards/UI/Extension/UICollectionView+Extensions.swift new file mode 100644 index 00000000..c7ad7f36 --- /dev/null +++ b/client/CoolCards/UI/Extension/UICollectionView+Extensions.swift @@ -0,0 +1,29 @@ +// +// UICollectionView+Extensions.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import UIKit + +extension UICollectionView { + + func registerReusableCell(_: T.Type) where T: ReusableView { + self.register(T.self, forCellWithReuseIdentifier: T.DefaultReuseIdentifier) + } + + func registerReusableCell(_: T.Type) where T: ReusableView, T: NibLoadableView { + let bundle = Bundle(for: T.self) + let nib = UINib(nibName: T.nibName, bundle: bundle) + self.register(nib, forCellWithReuseIdentifier: T.DefaultReuseIdentifier) + } + + func dequeueReusableCell(indexPath: IndexPath) -> T where T: ReusableView { + guard let cell = dequeueReusableCell(withReuseIdentifier: T.DefaultReuseIdentifier, for: indexPath) as? T else { + fatalError("Could not dequeue cell with identifier: \(T.DefaultReuseIdentifier)") + } + return cell + } +} diff --git a/client/CoolCards/UI/Extension/UIImageView+Extensions.swift b/client/CoolCards/UI/Extension/UIImageView+Extensions.swift new file mode 100644 index 00000000..8c43ff51 --- /dev/null +++ b/client/CoolCards/UI/Extension/UIImageView+Extensions.swift @@ -0,0 +1,23 @@ +// +// UIImageView+Extensions.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import UIKit +import SDWebImage + +extension UIImageView { + func setImage(imageURL:URL?, animatedOnce: Bool = true, placeholder: UIImage? = nil) { + let hasImage: Bool = (self.image != nil) + self.sd_setImage(with: imageURL, placeholderImage: nil, options: .avoidAutoSetImage) { [weak self] (image, error, cacheType, url) in + if animatedOnce && !hasImage && cacheType == .none { + self?.alpha = 0.0 + UIView.animate(withDuration: 0.5) { self?.alpha = 1.0 } + } + self?.image = image + } + } +} diff --git a/client/CoolCards/UI/Extension/UIView+Extensions.swift b/client/CoolCards/UI/Extension/UIView+Extensions.swift new file mode 100644 index 00000000..bd8c1dae --- /dev/null +++ b/client/CoolCards/UI/Extension/UIView+Extensions.swift @@ -0,0 +1,32 @@ +// +// UIView+Extensions.swift +// CoolCards +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import UIKit + +protocol ReusableView: class { + + static var DefaultReuseIdentifier: String { get } +} + +extension ReusableView where Self: UIView { + + static var DefaultReuseIdentifier: String { return NSStringFromClass(self) } +} + +protocol NibLoadableView: class { + + static var nibName: String { get } +} + +extension NibLoadableView where Self: UIView { + + static var nibName: String { + return NSStringFromClass(self).components(separatedBy: ".").last! + } +} + diff --git a/client/CoolCards/UI/Storyboards/Base.lproj/LaunchScreen.storyboard b/client/CoolCards/UI/Storyboards/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f83f6fd5 --- /dev/null +++ b/client/CoolCards/UI/Storyboards/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/CoolCards/UI/Storyboards/Base.lproj/Main.storyboard b/client/CoolCards/UI/Storyboards/Base.lproj/Main.storyboard new file mode 100644 index 00000000..75c73de5 --- /dev/null +++ b/client/CoolCards/UI/Storyboards/Base.lproj/Main.storyboard @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/CoolCardsIntegrationTests/CoolCardsIntegrationTests.swift b/client/CoolCardsIntegrationTests/CoolCardsIntegrationTests.swift new file mode 100644 index 00000000..5da2422c --- /dev/null +++ b/client/CoolCardsIntegrationTests/CoolCardsIntegrationTests.swift @@ -0,0 +1,41 @@ +// +// CoolCardsAPIIntegrationTests.swift +// CoolCardsIntegrationTests +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import XCTest +@testable import CoolCards + +class CoolCardsAPIIntegrationTests: XCTestCase { + + func testGetCards() { + let cardsExpectation = expectation(description: "We should some cards") + CoolCardsAPI.getCards(completion: { cards, error in + XCTAssert(error == nil) + XCTAssert(cards != nil) + XCTAssert(cards!.count > 0) + cardsExpectation.fulfill() + }) + waitForExpectations(timeout: 10, handler: { error in + XCTAssertNil(error) + }) + } + + func testGetCard() { + let cardExpectation = expectation(description: "We should get a card") + let cardId = "1" + CoolCardsAPI.getCard(cardId: cardId, completion: { card, error in + XCTAssert(error == nil) + XCTAssert(card != nil) + XCTAssert(card!.cardId == cardId) + cardExpectation.fulfill() + }) + waitForExpectations(timeout: 10, handler: { error in + XCTAssertNil(error) + }) + } + +} diff --git a/client/CoolCardsIntegrationTests/Info.plist b/client/CoolCardsIntegrationTests/Info.plist new file mode 100644 index 00000000..6c40a6cd --- /dev/null +++ b/client/CoolCardsIntegrationTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/client/CoolCardsTests/CoolCardsTests.swift b/client/CoolCardsTests/CoolCardsTests.swift new file mode 100644 index 00000000..b23ab9d6 --- /dev/null +++ b/client/CoolCardsTests/CoolCardsTests.swift @@ -0,0 +1,36 @@ +// +// CoolCardsTests.swift +// CoolCardsTests +// +// Created by Chatterjee, Sumeru(AWF) on 12/18/17. +// Copyright © 2017 Chatterjee, Sumeru. All rights reserved. +// + +import XCTest +@testable import CoolCards + +class CoolCardsTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/client/CoolCardsTests/Info.plist b/client/CoolCardsTests/Info.plist new file mode 100644 index 00000000..6c40a6cd --- /dev/null +++ b/client/CoolCardsTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/client/Podfile b/client/Podfile new file mode 100644 index 00000000..11ebeb16 --- /dev/null +++ b/client/Podfile @@ -0,0 +1,22 @@ +platform :ios, '10.0' +use_frameworks! + +project 'CoolCards.xcodeproj' + +def core_pods + pod 'Moya' + pod 'SDWebImage' + pod 'FontAwesome.swift' +end + +target 'CoolCards' do + core_pods +end + +target 'CoolCardsTests' do + core_pods +end + +target 'CoolCardsIntegrationTests' do + core_pods +end diff --git a/client/Podfile.lock b/client/Podfile.lock new file mode 100644 index 00000000..72445d44 --- /dev/null +++ b/client/Podfile.lock @@ -0,0 +1,28 @@ +PODS: + - Alamofire (4.5.1) + - FontAwesome.swift (1.3.2) + - Moya (10.0.0): + - Moya/Core (= 10.0.0) + - Moya/Core (10.0.0): + - Alamofire (~> 4.1) + - Result (~> 3.0) + - Result (3.2.4) + - SDWebImage (4.2.2): + - SDWebImage/Core (= 4.2.2) + - SDWebImage/Core (4.2.2) + +DEPENDENCIES: + - FontAwesome.swift + - Moya + - SDWebImage + +SPEC CHECKSUMS: + Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a + FontAwesome.swift: b4e4c8ccbbecb12f9b592bc533ff237af3706667 + Moya: adb58b0f4e58430db43cc6e2f6ebab1836501186 + Result: d2d07204ce72856f1fd9130bbe42c35a7b0fea10 + SDWebImage: 89a9d32cd520bbb46eb14e541d5109b3564af198 + +PODFILE CHECKSUM: 63b743108d1d7464ec33801a55ca17bbb8f865ae + +COCOAPODS: 1.3.1 diff --git a/client/Pods/Alamofire/LICENSE b/client/Pods/Alamofire/LICENSE new file mode 100644 index 00000000..16546027 --- /dev/null +++ b/client/Pods/Alamofire/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/client/Pods/Alamofire/README.md b/client/Pods/Alamofire/README.md new file mode 100644 index 00000000..f190df92 --- /dev/null +++ b/client/Pods/Alamofire/README.md @@ -0,0 +1,1862 @@ +![Alamofire: Elegant Networking in Swift](https://raw.githubusercontent.com/Alamofire/Alamofire/master/alamofire.png) + +[![Build Status](https://travis-ci.org/Alamofire/Alamofire.svg?branch=master)](https://travis-ci.org/Alamofire/Alamofire) +[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg)](https://img.shields.io/cocoapods/v/Alamofire.svg) +[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](https://alamofire.github.io/Alamofire) +[![Twitter](https://img.shields.io/badge/twitter-@AlamofireSF-blue.svg?style=flat)](http://twitter.com/AlamofireSF) +[![Gitter](https://badges.gitter.im/Alamofire/Alamofire.svg)](https://gitter.im/Alamofire/Alamofire?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + +Alamofire is an HTTP networking library written in Swift. + +- [Features](#features) +- [Component Libraries](#component-libraries) +- [Requirements](#requirements) +- [Migration Guides](#migration-guides) +- [Communication](#communication) +- [Installation](#installation) +- [Usage](#usage) + - **Intro -** [Making a Request](#making-a-request), [Response Handling](#response-handling), [Response Validation](#response-validation), [Response Caching](#response-caching) + - **HTTP -** [HTTP Methods](#http-methods), [Parameter Encoding](#parameter-encoding), [HTTP Headers](#http-headers), [Authentication](#authentication) + - **Large Data -** [Downloading Data to a File](#downloading-data-to-a-file), [Uploading Data to a Server](#uploading-data-to-a-server) + - **Tools -** [Statistical Metrics](#statistical-metrics), [cURL Command Output](#curl-command-output) +- [Advanced Usage](#advanced-usage) + - **URL Session -** [Session Manager](#session-manager), [Session Delegate](#session-delegate), [Request](#request) + - **Routing -** [Routing Requests](#routing-requests), [Adapting and Retrying Requests](#adapting-and-retrying-requests) + - **Model Objects -** [Custom Response Serialization](#custom-response-serialization) + - **Connection -** [Security](#security), [Network Reachability](#network-reachability) +- [Open Radars](#open-radars) +- [FAQ](#faq) +- [Credits](#credits) +- [Donations](#donations) +- [License](#license) + +## Features + +- [x] Chainable Request / Response Methods +- [x] URL / JSON / plist Parameter Encoding +- [x] Upload File / Data / Stream / MultipartFormData +- [x] Download File using Request or Resume Data +- [x] Authentication with URLCredential +- [x] HTTP Response Validation +- [x] Upload and Download Progress Closures with Progress +- [x] cURL Command Output +- [x] Dynamically Adapt and Retry Requests +- [x] TLS Certificate and Public Key Pinning +- [x] Network Reachability +- [x] Comprehensive Unit and Integration Test Coverage +- [x] [Complete Documentation](https://alamofire.github.io/Alamofire) + +## Component Libraries + +In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem. + +- [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system. +- [AlamofireNetworkActivityIndicator](https://github.com/Alamofire/AlamofireNetworkActivityIndicator) - Controls the visibility of the network activity indicator on iOS using Alamofire. It contains configurable delay timers to help mitigate flicker and can support `URLSession` instances not managed by Alamofire. + +## Requirements + +- iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ +- Xcode 8.3+ +- Swift 3.1+ + +## Migration Guides + +- [Alamofire 4.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%204.0%20Migration%20Guide.md) +- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md) +- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md) + +## Communication + +- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). (Tag 'alamofire') +- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). +- If you **found a bug**, open an issue. +- If you **have a feature request**, open an issue. +- If you **want to contribute**, submit a pull request. + +## Installation + +### CocoaPods + +[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: + +```bash +$ gem install cocoapods +``` + +> CocoaPods 1.1+ is required to build Alamofire 4.0+. + +To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: + +```ruby +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '10.0' +use_frameworks! + +target '' do + pod 'Alamofire', '~> 4.5' +end +``` + +Then, run the following command: + +```bash +$ pod install +``` + +### Carthage + +[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. + +You can install Carthage with [Homebrew](http://brew.sh/) using the following command: + +```bash +$ brew update +$ brew install carthage +``` + +To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: + +```ogdl +github "Alamofire/Alamofire" ~> 4.5 +``` + +Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. + +### Swift Package Manager + +The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but Alamofire does support its use on supported platforms. + +Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. + +```swift +dependencies: [ + .Package(url: "https://github.com/Alamofire/Alamofire.git", majorVersion: 4) +] +``` + +### Manually + +If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually. + +#### Embedded Framework + +- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: + + ```bash + $ git init + ``` + +- Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: + + ```bash + $ git submodule add https://github.com/Alamofire/Alamofire.git + ``` + +- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. + + > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. + +- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. +- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. +- In the tab bar at the top of that window, open the "General" panel. +- Click on the `+` button under the "Embedded Binaries" section. +- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. + + > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. + +- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. + + > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS`, `Alamofire macOS`, `Alamofire tvOS` or `Alamofire watchOS`. + +- And that's it! + + > The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. + +--- + +## Usage + +### Making a Request + +```swift +import Alamofire + +Alamofire.request("https://httpbin.org/get") +``` + +### Response Handling + +Handling the `Response` of a `Request` made in Alamofire involves chaining a response handler onto the `Request`. + +```swift +Alamofire.request("https://httpbin.org/get").responseJSON { response in + print("Request: \(String(describing: response.request))") // original url request + print("Response: \(String(describing: response.response))") // http url response + print("Result: \(response.result)") // response serialization result + + if let json = response.result.value { + print("JSON: \(json)") // serialized json response + } + + if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { + print("Data: \(utf8Text)") // original server data as UTF8 string + } +} +``` + +In the above example, the `responseJSON` handler is appended to the `Request` to be executed once the `Request` is complete. Rather than blocking execution to wait for a response from the server, a [callback](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) in the form of a closure is specified to handle the response once it's received. The result of a request is only available inside the scope of a response closure. Any execution contingent on the response or data received from the server must be done within a response closure. + +> Networking in Alamofire is done _asynchronously_. Asynchronous programming may be a source of frustration to programmers unfamiliar with the concept, but there are [very good reasons](https://developer.apple.com/library/ios/qa/qa1693/_index.html) for doing it this way. + +Alamofire contains five different response handlers by default including: + +```swift +// Response Handler - Unserialized Response +func response( + queue: DispatchQueue?, + completionHandler: @escaping (DefaultDataResponse) -> Void) + -> Self + +// Response Data Handler - Serialized into Data +func responseData( + queue: DispatchQueue?, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + +// Response String Handler - Serialized into String +func responseString( + queue: DispatchQueue?, + encoding: String.Encoding?, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + +// Response JSON Handler - Serialized into Any +func responseJSON( + queue: DispatchQueue?, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + +// Response PropertyList (plist) Handler - Serialized into Any +func responsePropertyList( + queue: DispatchQueue?, + completionHandler: @escaping (DataResponse) -> Void)) + -> Self +``` + +None of the response handlers perform any validation of the `HTTPURLResponse` it gets back from the server. + +> For example, response status codes in the `400..<500` and `500..<600` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. + +#### Response Handler + +The `response` handler does NOT evaluate any of the response data. It merely forwards on all information directly from the URL session delegate. It is the Alamofire equivalent of using `cURL` to execute a `Request`. + +```swift +Alamofire.request("https://httpbin.org/get").response { response in + print("Request: \(response.request)") + print("Response: \(response.response)") + print("Error: \(response.error)") + + if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { + print("Data: \(utf8Text)") + } +} +``` + +> We strongly encourage you to leverage the other response serializers taking advantage of `Response` and `Result` types. + +#### Response Data Handler + +The `responseData` handler uses the `responseDataSerializer` (the object that serializes the server data into some other type) to extract the `Data` returned by the server. If no errors occur and `Data` is returned, the response `Result` will be a `.success` and the `value` will be of type `Data`. + +```swift +Alamofire.request("https://httpbin.org/get").responseData { response in + debugPrint("All Response Info: \(response)") + + if let data = response.result.value, let utf8Text = String(data: data, encoding: .utf8) { + print("Data: \(utf8Text)") + } +} +``` + +#### Response String Handler + +The `responseString` handler uses the `responseStringSerializer` to convert the `Data` returned by the server into a `String` with the specified encoding. If no errors occur and the server data is successfully serialized into a `String`, the response `Result` will be a `.success` and the `value` will be of type `String`. + +```swift +Alamofire.request("https://httpbin.org/get").responseString { response in + print("Success: \(response.result.isSuccess)") + print("Response String: \(response.result.value)") +} +``` + +> If no encoding is specified, Alamofire will use the text encoding specified in the `HTTPURLResponse` from the server. If the text encoding cannot be determined by the server response, it defaults to `.isoLatin1`. + +#### Response JSON Handler + +The `responseJSON` handler uses the `responseJSONSerializer` to convert the `Data` returned by the server into an `Any` type using the specified `JSONSerialization.ReadingOptions`. If no errors occur and the server data is successfully serialized into a JSON object, the response `Result` will be a `.success` and the `value` will be of type `Any`. + +```swift +Alamofire.request("https://httpbin.org/get").responseJSON { response in + debugPrint(response) + + if let json = response.result.value { + print("JSON: \(json)") + } +} +``` + +> All JSON serialization is handled by the `JSONSerialization` API in the `Foundation` framework. + +#### Chained Response Handlers + +Response handlers can even be chained: + +```swift +Alamofire.request("https://httpbin.org/get") + .responseString { response in + print("Response String: \(response.result.value)") + } + .responseJSON { response in + print("Response JSON: \(response.result.value)") + } +``` + +> It is important to note that using multiple response handlers on the same `Request` requires the server data to be serialized multiple times. Once for each response handler. + +#### Response Handler Queue + +Response handlers by default are executed on the main dispatch queue. However, a custom dispatch queue can be provided instead. + +```swift +let utilityQueue = DispatchQueue.global(qos: .utility) + +Alamofire.request("https://httpbin.org/get").responseJSON(queue: utilityQueue) { response in + print("Executing response handler on utility queue") +} +``` + +### Response Validation + +By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling `validate` before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type. + +#### Manual Validation + +```swift +Alamofire.request("https://httpbin.org/get") + .validate(statusCode: 200..<300) + .validate(contentType: ["application/json"]) + .responseData { response in + switch response.result { + case .success: + print("Validation Successful") + case .failure(let error): + print(error) + } + } +``` + +#### Automatic Validation + +Automatically validates status code within `200..<300` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. + +```swift +Alamofire.request("https://httpbin.org/get").validate().responseJSON { response in + switch response.result { + case .success: + print("Validation Successful") + case .failure(let error): + print(error) + } +} +``` + +### Response Caching + +Response Caching is handled on the system framework level by [`URLCache`](https://developer.apple.com/reference/foundation/urlcache). It provides a composite in-memory and on-disk cache and lets you manipulate the sizes of both the in-memory and on-disk portions. + +> By default, Alamofire leverages the shared `URLCache`. In order to customize it, see the [Session Manager Configurations](#session-manager) section. + +### HTTP Methods + +The `HTTPMethod` enumeration lists the HTTP methods defined in [RFC 7231 §4.3](http://tools.ietf.org/html/rfc7231#section-4.3): + +```swift +public enum HTTPMethod: String { + case options = "OPTIONS" + case get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case trace = "TRACE" + case connect = "CONNECT" +} +``` + +These values can be passed as the `method` argument to the `Alamofire.request` API: + +```swift +Alamofire.request("https://httpbin.org/get") // method defaults to `.get` + +Alamofire.request("https://httpbin.org/post", method: .post) +Alamofire.request("https://httpbin.org/put", method: .put) +Alamofire.request("https://httpbin.org/delete", method: .delete) +``` + +> The `Alamofire.request` method parameter defaults to `.get`. + +### Parameter Encoding + +Alamofire supports three types of parameter encoding including: `URL`, `JSON` and `PropertyList`. It can also support any custom encoding that conforms to the `ParameterEncoding` protocol. + +#### URL Encoding + +The `URLEncoding` type creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP body of the URL request. Whether the query string is set or appended to any existing URL query string or set as the HTTP body depends on the `Destination` of the encoding. The `Destination` enumeration has three cases: + +- `.methodDependent` - Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` requests and sets as the HTTP body for requests with any other HTTP method. +- `.queryString` - Sets or appends encoded query string result to existing query string. +- `.httpBody` - Sets encoded query string result as the HTTP body of the URL request. + +The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification for how to encode collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`). + +##### GET Request With URL-Encoded Parameters + +```swift +let parameters: Parameters = ["foo": "bar"] + +// All three of these calls are equivalent +Alamofire.request("https://httpbin.org/get", parameters: parameters) // encoding defaults to `URLEncoding.default` +Alamofire.request("https://httpbin.org/get", parameters: parameters, encoding: URLEncoding.default) +Alamofire.request("https://httpbin.org/get", parameters: parameters, encoding: URLEncoding(destination: .methodDependent)) + +// https://httpbin.org/get?foo=bar +``` + +##### POST Request With URL-Encoded Parameters + +```swift +let parameters: Parameters = [ + "foo": "bar", + "baz": ["a", 1], + "qux": [ + "x": 1, + "y": 2, + "z": 3 + ] +] + +// All three of these calls are equivalent +Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters) +Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: URLEncoding.default) +Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: URLEncoding.httpBody) + +// HTTP body: foo=bar&baz[]=a&baz[]=1&qux[x]=1&qux[y]=2&qux[z]=3 +``` + +#### JSON Encoding + +The `JSONEncoding` type creates a JSON representation of the parameters object, which is set as the HTTP body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. + +##### POST Request with JSON-Encoded Parameters + +```swift +let parameters: Parameters = [ + "foo": [1,2,3], + "bar": [ + "baz": "qux" + ] +] + +// Both calls are equivalent +Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding.default) +Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding(options: [])) + +// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}} +``` + +#### Property List Encoding + +The `PropertyListEncoding` uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`. + +#### Custom Encoding + +In the event that the provided `ParameterEncoding` types do not meet your needs, you can create your own custom encoding. Here's a quick example of how you could build a custom `JSONStringArrayEncoding` type to encode a JSON string array onto a `Request`. + +```swift +struct JSONStringArrayEncoding: ParameterEncoding { + private let array: [String] + + init(array: [String]) { + self.array = array + } + + func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + let data = try JSONSerialization.data(withJSONObject: array, options: []) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + + return urlRequest + } +} +``` + +#### Manual Parameter Encoding of a URLRequest + +The `ParameterEncoding` APIs can be used outside of making network requests. + +```swift +let url = URL(string: "https://httpbin.org/get")! +var urlRequest = URLRequest(url: url) + +let parameters: Parameters = ["foo": "bar"] +let encodedURLRequest = try URLEncoding.queryString.encode(urlRequest, with: parameters) +``` + +### HTTP Headers + +Adding a custom HTTP header to a `Request` is supported directly in the global `request` method. This makes it easy to attach HTTP headers to a `Request` that can be constantly changing. + +```swift +let headers: HTTPHeaders = [ + "Authorization": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", + "Accept": "application/json" +] + +Alamofire.request("https://httpbin.org/headers", headers: headers).responseJSON { response in + debugPrint(response) +} +``` + +> For HTTP headers that do not change, it is recommended to set them on the `URLSessionConfiguration` so they are automatically applied to any `URLSessionTask` created by the underlying `URLSession`. For more information, see the [Session Manager Configurations](#session-manager) section. + +The default Alamofire `SessionManager` provides a default set of headers for every `Request`. These include: + +- `Accept-Encoding`, which defaults to `gzip;q=1.0, compress;q=0.5`, per [RFC 7230 §4.2.3](https://tools.ietf.org/html/rfc7230#section-4.2.3). +- `Accept-Language`, which defaults to up to the top 6 preferred languages on the system, formatted like `en;q=1.0`, per [RFC 7231 §5.3.5](https://tools.ietf.org/html/rfc7231#section-5.3.5). +- `User-Agent`, which contains versioning information about the current app. For example: `iOS Example/1.0 (com.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0`, per [RFC 7231 §5.5.3](https://tools.ietf.org/html/rfc7231#section-5.5.3). + +If you need to customize these headers, a custom `URLSessionConfiguration` should be created, the `defaultHTTPHeaders` property updated and the configuration applied to a new `SessionManager` instance. + +### Authentication + +Authentication is handled on the system framework level by [`URLCredential`](https://developer.apple.com/reference/foundation/nsurlcredential) and [`URLAuthenticationChallenge`](https://developer.apple.com/reference/foundation/urlauthenticationchallenge). + +**Supported Authentication Schemes** + +- [HTTP Basic](http://en.wikipedia.org/wiki/Basic_access_authentication) +- [HTTP Digest](http://en.wikipedia.org/wiki/Digest_access_authentication) +- [Kerberos](http://en.wikipedia.org/wiki/Kerberos_%28protocol%29) +- [NTLM](http://en.wikipedia.org/wiki/NT_LAN_Manager) + +#### HTTP Basic Authentication + +The `authenticate` method on a `Request` will automatically provide a `URLCredential` to a `URLAuthenticationChallenge` when appropriate: + +```swift +let user = "user" +let password = "password" + +Alamofire.request("https://httpbin.org/basic-auth/\(user)/\(password)") + .authenticate(user: user, password: password) + .responseJSON { response in + debugPrint(response) + } +``` + +Depending upon your server implementation, an `Authorization` header may also be appropriate: + +```swift +let user = "user" +let password = "password" + +var headers: HTTPHeaders = [:] + +if let authorizationHeader = Request.authorizationHeader(user: user, password: password) { + headers[authorizationHeader.key] = authorizationHeader.value +} + +Alamofire.request("https://httpbin.org/basic-auth/user/password", headers: headers) + .responseJSON { response in + debugPrint(response) + } +``` + +#### Authentication with URLCredential + +```swift +let user = "user" +let password = "password" + +let credential = URLCredential(user: user, password: password, persistence: .forSession) + +Alamofire.request("https://httpbin.org/basic-auth/\(user)/\(password)") + .authenticate(usingCredential: credential) + .responseJSON { response in + debugPrint(response) + } +``` + +> It is important to note that when using a `URLCredential` for authentication, the underlying `URLSession` will actually end up making two requests if a challenge is issued by the server. The first request will not include the credential which "may" trigger a challenge from the server. The challenge is then received by Alamofire, the credential is appended and the request is retried by the underlying `URLSession`. + +### Downloading Data to a File + +Requests made in Alamofire that fetch data from a server can download the data in-memory or on-disk. The `Alamofire.request` APIs used in all the examples so far always downloads the server data in-memory. This is great for smaller payloads because it's more efficient, but really bad for larger payloads because the download could run your entire application out-of-memory. Because of this, you can also use the `Alamofire.download` APIs to download the server data to a temporary file on-disk. + +> This will only work on `macOS` as is. Other platforms don't allow access to the filesystem outside of your app's sandbox. To download files on other platforms, see the [Download File Destination](#download-file-destination) section. + +```swift +Alamofire.download("https://httpbin.org/image/png").responseData { response in + if let data = response.result.value { + let image = UIImage(data: data) + } +} +``` + +> The `Alamofire.download` APIs should also be used if you need to download data while your app is in the background. For more information, please see the [Session Manager Configurations](#session-manager) section. + +#### Download File Destination + +You can also provide a `DownloadFileDestination` closure to move the file from the temporary directory to a final destination. Before the temporary file is actually moved to the `destinationURL`, the `DownloadOptions` specified in the closure will be executed. The two currently supported `DownloadOptions` are: + +- `.createIntermediateDirectories` - Creates intermediate directories for the destination URL if specified. +- `.removePreviousFile` - Removes a previous file from the destination URL if specified. + +```swift +let destination: DownloadRequest.DownloadFileDestination = { _, _ in + let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let fileURL = documentsURL.appendingPathComponent("pig.png") + + return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) +} + +Alamofire.download(urlString, to: destination).response { response in + print(response) + + if response.error == nil, let imagePath = response.destinationURL?.path { + let image = UIImage(contentsOfFile: imagePath) + } +} +``` + +You can also use the suggested download destination API. + +```swift +let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory) +Alamofire.download("https://httpbin.org/image/png", to: destination) +``` + +#### Download Progress + +Many times it can be helpful to report download progress to the user. Any `DownloadRequest` can report download progress using the `downloadProgress` API. + +```swift +Alamofire.download("https://httpbin.org/image/png") + .downloadProgress { progress in + print("Download Progress: \(progress.fractionCompleted)") + } + .responseData { response in + if let data = response.result.value { + let image = UIImage(data: data) + } + } +``` + +The `downloadProgress` API also takes a `queue` parameter which defines which `DispatchQueue` the download progress closure should be called on. + +```swift +let utilityQueue = DispatchQueue.global(qos: .utility) + +Alamofire.download("https://httpbin.org/image/png") + .downloadProgress(queue: utilityQueue) { progress in + print("Download Progress: \(progress.fractionCompleted)") + } + .responseData { response in + if let data = response.result.value { + let image = UIImage(data: data) + } + } +``` + +#### Resuming a Download + +If a `DownloadRequest` is cancelled or interrupted, the underlying URL session may generate resume data for the active `DownloadRequest`. If this happens, the resume data can be re-used to restart the `DownloadRequest` where it left off. The resume data can be accessed through the download response, then reused when trying to restart the request. + +> **IMPORTANT:** On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the data is written incorrectly and will always fail to resume the download. For more information about the bug and possible workarounds, please see this Stack Overflow [post](http://stackoverflow.com/a/39347461/1342462). + +```swift +class ImageRequestor { + private var resumeData: Data? + private var image: UIImage? + + func fetchImage(completion: (UIImage?) -> Void) { + guard image == nil else { completion(image) ; return } + + let destination: DownloadRequest.DownloadFileDestination = { _, _ in + let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let fileURL = documentsURL.appendingPathComponent("pig.png") + + return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) + } + + let request: DownloadRequest + + if let resumeData = resumeData { + request = Alamofire.download(resumingWith: resumeData) + } else { + request = Alamofire.download("https://httpbin.org/image/png") + } + + request.responseData { response in + switch response.result { + case .success(let data): + self.image = UIImage(data: data) + case .failure: + self.resumeData = response.resumeData + } + } + } +} +``` + +### Uploading Data to a Server + +When sending relatively small amounts of data to a server using JSON or URL encoded parameters, the `Alamofire.request` APIs are usually sufficient. If you need to send much larger amounts of data from a file URL or an `InputStream`, then the `Alamofire.upload` APIs are what you want to use. + +> The `Alamofire.upload` APIs should also be used if you need to upload data while your app is in the background. For more information, please see the [Session Manager Configurations](#session-manager) section. + +#### Uploading Data + +```swift +let imageData = UIImagePNGRepresentation(image)! + +Alamofire.upload(imageData, to: "https://httpbin.org/post").responseJSON { response in + debugPrint(response) +} +``` + +#### Uploading a File + +```swift +let fileURL = Bundle.main.url(forResource: "video", withExtension: "mov") + +Alamofire.upload(fileURL, to: "https://httpbin.org/post").responseJSON { response in + debugPrint(response) +} +``` + +#### Uploading Multipart Form Data + +```swift +Alamofire.upload( + multipartFormData: { multipartFormData in + multipartFormData.append(unicornImageURL, withName: "unicorn") + multipartFormData.append(rainbowImageURL, withName: "rainbow") + }, + to: "https://httpbin.org/post", + encodingCompletion: { encodingResult in + switch encodingResult { + case .success(let upload, _, _): + upload.responseJSON { response in + debugPrint(response) + } + case .failure(let encodingError): + print(encodingError) + } + } +) +``` + +#### Upload Progress + +While your user is waiting for their upload to complete, sometimes it can be handy to show the progress of the upload to the user. Any `UploadRequest` can report both upload progress and download progress of the response data using the `uploadProgress` and `downloadProgress` APIs. + +```swift +let fileURL = Bundle.main.url(forResource: "video", withExtension: "mov") + +Alamofire.upload(fileURL, to: "https://httpbin.org/post") + .uploadProgress { progress in // main queue by default + print("Upload Progress: \(progress.fractionCompleted)") + } + .downloadProgress { progress in // main queue by default + print("Download Progress: \(progress.fractionCompleted)") + } + .responseJSON { response in + debugPrint(response) + } +``` + +### Statistical Metrics + +#### Timeline + +Alamofire collects timings throughout the lifecycle of a `Request` and creates a `Timeline` object exposed as a property on all response types. + +```swift +Alamofire.request("https://httpbin.org/get").responseJSON { response in + print(response.timeline) +} +``` + +The above reports the following `Timeline` info: + +- `Latency`: 0.428 seconds +- `Request Duration`: 0.428 seconds +- `Serialization Duration`: 0.001 seconds +- `Total Duration`: 0.429 seconds + +#### URL Session Task Metrics + +In iOS and tvOS 10 and macOS 10.12, Apple introduced the new [URLSessionTaskMetrics](https://developer.apple.com/reference/foundation/urlsessiontaskmetrics) APIs. The task metrics encapsulate some fantastic statistical information about the request and response execution. The API is very similar to the `Timeline`, but provides many more statistics that Alamofire doesn't have access to compute. The metrics can be accessed through any response type. + +```swift +Alamofire.request("https://httpbin.org/get").responseJSON { response in + print(response.metrics) +} +``` + +It's important to note that these APIs are only available on iOS and tvOS 10 and macOS 10.12. Therefore, depending on your deployment target, you may need to use these inside availability checks: + +```swift +Alamofire.request("https://httpbin.org/get").responseJSON { response in + if #available(iOS 10.0, *) { + print(response.metrics) + } +} +``` + +### cURL Command Output + +Debugging platform issues can be frustrating. Thankfully, Alamofire `Request` objects conform to both the `CustomStringConvertible` and `CustomDebugStringConvertible` protocols to provide some VERY helpful debugging tools. + +#### CustomStringConvertible + +```swift +let request = Alamofire.request("https://httpbin.org/ip") + +print(request) +// GET https://httpbin.org/ip (200) +``` + +#### CustomDebugStringConvertible + +```swift +let request = Alamofire.request("https://httpbin.org/get", parameters: ["foo": "bar"]) +debugPrint(request) +``` + +Outputs: + +```bash +$ curl -i \ + -H "User-Agent: Alamofire/4.0.0" \ + -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ + -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ + "https://httpbin.org/get?foo=bar" +``` + +--- + +## Advanced Usage + +Alamofire is built on `URLSession` and the Foundation URL Loading System. To make the most of this framework, it is recommended that you be familiar with the concepts and capabilities of the underlying networking stack. + +**Recommended Reading** + +- [URL Loading System Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html) +- [URLSession Class Reference](https://developer.apple.com/reference/foundation/nsurlsession) +- [URLCache Class Reference](https://developer.apple.com/reference/foundation/urlcache) +- [URLAuthenticationChallenge Class Reference](https://developer.apple.com/reference/foundation/urlauthenticationchallenge) + +### Session Manager + +Top-level convenience methods like `Alamofire.request` use a default instance of `Alamofire.SessionManager`, which is configured with the default `URLSessionConfiguration`. + +As such, the following two statements are equivalent: + +```swift +Alamofire.request("https://httpbin.org/get") +``` + +```swift +let sessionManager = Alamofire.SessionManager.default +sessionManager.request("https://httpbin.org/get") +``` + +Applications can create session managers for background and ephemeral sessions, as well as new managers that customize the default session configuration, such as for default headers (`httpAdditionalHeaders`) or timeout interval (`timeoutIntervalForRequest`). + +#### Creating a Session Manager with Default Configuration + +```swift +let configuration = URLSessionConfiguration.default +let sessionManager = Alamofire.SessionManager(configuration: configuration) +``` + +#### Creating a Session Manager with Background Configuration + +```swift +let configuration = URLSessionConfiguration.background(withIdentifier: "com.example.app.background") +let sessionManager = Alamofire.SessionManager(configuration: configuration) +``` + +#### Creating a Session Manager with Ephemeral Configuration + +```swift +let configuration = URLSessionConfiguration.ephemeral +let sessionManager = Alamofire.SessionManager(configuration: configuration) +``` + +#### Modifying the Session Configuration + +```swift +var defaultHeaders = Alamofire.SessionManager.defaultHTTPHeaders +defaultHeaders["DNT"] = "1 (Do Not Track Enabled)" + +let configuration = URLSessionConfiguration.default +configuration.httpAdditionalHeaders = defaultHeaders + +let sessionManager = Alamofire.SessionManager(configuration: configuration) +``` + +> This is **not** recommended for `Authorization` or `Content-Type` headers. Instead, use the `headers` parameter in the top-level `Alamofire.request` APIs, `URLRequestConvertible` and `ParameterEncoding`, respectively. + +### Session Delegate + +By default, an Alamofire `SessionManager` instance creates a `SessionDelegate` object to handle all the various types of delegate callbacks that are generated by the underlying `URLSession`. The implementations of each delegate method handle the most common use cases for these types of calls abstracting the complexity away from the top-level APIs. However, advanced users may find the need to override the default functionality for various reasons. + +#### Override Closures + +The first way to customize the `SessionDelegate` behavior is through the use of the override closures. Each closure gives you the ability to override the implementation of the matching `SessionDelegate` API, yet still use the default implementation for all other APIs. This makes it easy to customize subsets of the delegate functionality. Here are a few examples of some of the override closures available: + +```swift +/// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`. +open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + +/// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. +open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? + +/// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`. +open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? + +/// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`. +open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? +``` + +The following is a short example of how to use the `taskWillPerformHTTPRedirection` to avoid following redirects to any `apple.com` domains. + +```swift +let sessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.default) +let delegate: Alamofire.SessionDelegate = sessionManager.delegate + +delegate.taskWillPerformHTTPRedirection = { session, task, response, request in + var finalRequest = request + + if + let originalRequest = task.originalRequest, + let urlString = originalRequest.url?.urlString, + urlString.contains("apple.com") + { + finalRequest = originalRequest + } + + return finalRequest +} +``` + +#### Subclassing + +Another way to override the default implementation of the `SessionDelegate` is to subclass it. Subclassing allows you completely customize the behavior of the API or to create a proxy for the API and still use the default implementation. Creating a proxy allows you to log events, emit notifications, provide pre and post hook implementations, etc. Here's a quick example of subclassing the `SessionDelegate` and logging a message when a redirect occurs. + +```swift +class LoggingSessionDelegate: SessionDelegate { + override func urlSession( + _ session: URLSession, + task: URLSessionTask, + willPerformHTTPRedirection response: HTTPURLResponse, + newRequest request: URLRequest, + completionHandler: @escaping (URLRequest?) -> Void) + { + print("URLSession will perform HTTP redirection to request: \(request)") + + super.urlSession( + session, + task: task, + willPerformHTTPRedirection: response, + newRequest: request, + completionHandler: completionHandler + ) + } +} +``` + +Generally speaking, either the default implementation or the override closures should provide the necessary functionality required. Subclassing should only be used as a last resort. + +> It is important to keep in mind that the `subdelegates` are initialized and destroyed in the default implementation. Be careful when subclassing to not introduce memory leaks. + +### Request + +The result of a `request`, `download`, `upload` or `stream` methods are a `DataRequest`, `DownloadRequest`, `UploadRequest` and `StreamRequest` which all inherit from `Request`. All `Request` instances are always created by an owning session manager, and never initialized directly. + +Each subclass has specialized methods such as `authenticate`, `validate`, `responseJSON` and `uploadProgress` that each return the caller instance in order to facilitate method chaining. + +Requests can be suspended, resumed and cancelled: + +- `suspend()`: Suspends the underlying task and dispatch queue. +- `resume()`: Resumes the underlying task and dispatch queue. If the owning manager does not have `startRequestsImmediately` set to `true`, the request must call `resume()` in order to start. +- `cancel()`: Cancels the underlying task, producing an error that is passed to any registered response handlers. + +### Routing Requests + +As apps grow in size, it's important to adopt common patterns as you build out your network stack. An important part of that design is how to route your requests. The Alamofire `URLConvertible` and `URLRequestConvertible` protocols along with the `Router` design pattern are here to help. + +#### URLConvertible + +Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct URL requests internally. `String`, `URL`, and `URLComponents` conform to `URLConvertible` by default, allowing any of them to be passed as `url` parameters to the `request`, `upload`, and `download` methods: + +```swift +let urlString = "https://httpbin.org/post" +Alamofire.request(urlString, method: .post) + +let url = URL(string: urlString)! +Alamofire.request(url, method: .post) + +let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: true)! +Alamofire.request(urlComponents, method: .post) +``` + +Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLConvertible` as a convenient way to map domain-specific models to server resources. + +##### Type-Safe Routing + +```swift +extension User: URLConvertible { + static let baseURLString = "https://example.com" + + func asURL() throws -> URL { + let urlString = User.baseURLString + "/users/\(username)/" + return try urlString.asURL() + } +} +``` + +```swift +let user = User(username: "mattt") +Alamofire.request(user) // https://example.com/users/mattt +``` + +#### URLRequestConvertible + +Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. `URLRequest` conforms to `URLRequestConvertible` by default, allowing it to be passed into `request`, `upload`, and `download` methods directly (this is the recommended way to specify custom HTTP body for individual requests): + +```swift +let url = URL(string: "https://httpbin.org/post")! +var urlRequest = URLRequest(url: url) +urlRequest.httpMethod = "POST" + +let parameters = ["foo": "bar"] + +do { + urlRequest.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: []) +} catch { + // No-op +} + +urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + +Alamofire.request(urlRequest) +``` + +Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLRequestConvertible` as a way to ensure consistency of requested endpoints. Such an approach can be used to abstract away server-side inconsistencies and provide type-safe routing, as well as manage authentication credentials and other state. + +##### API Parameter Abstraction + +```swift +enum Router: URLRequestConvertible { + case search(query: String, page: Int) + + static let baseURLString = "https://example.com" + static let perPage = 50 + + // MARK: URLRequestConvertible + + func asURLRequest() throws -> URLRequest { + let result: (path: String, parameters: Parameters) = { + switch self { + case let .search(query, page) where page > 0: + return ("/search", ["q": query, "offset": Router.perPage * page]) + case let .search(query, _): + return ("/search", ["q": query]) + } + }() + + let url = try Router.baseURLString.asURL() + let urlRequest = URLRequest(url: url.appendingPathComponent(result.path)) + + return try URLEncoding.default.encode(urlRequest, with: result.parameters) + } +} +``` + +```swift +Alamofire.request(Router.search(query: "foo bar", page: 1)) // https://example.com/search?q=foo%20bar&offset=50 +``` + +##### CRUD & Authorization + +```swift +import Alamofire + +enum Router: URLRequestConvertible { + case createUser(parameters: Parameters) + case readUser(username: String) + case updateUser(username: String, parameters: Parameters) + case destroyUser(username: String) + + static let baseURLString = "https://example.com" + + var method: HTTPMethod { + switch self { + case .createUser: + return .post + case .readUser: + return .get + case .updateUser: + return .put + case .destroyUser: + return .delete + } + } + + var path: String { + switch self { + case .createUser: + return "/users" + case .readUser(let username): + return "/users/\(username)" + case .updateUser(let username, _): + return "/users/\(username)" + case .destroyUser(let username): + return "/users/\(username)" + } + } + + // MARK: URLRequestConvertible + + func asURLRequest() throws -> URLRequest { + let url = try Router.baseURLString.asURL() + + var urlRequest = URLRequest(url: url.appendingPathComponent(path)) + urlRequest.httpMethod = method.rawValue + + switch self { + case .createUser(let parameters): + urlRequest = try URLEncoding.default.encode(urlRequest, with: parameters) + case .updateUser(_, let parameters): + urlRequest = try URLEncoding.default.encode(urlRequest, with: parameters) + default: + break + } + + return urlRequest + } +} +``` + +```swift +Alamofire.request(Router.readUser("mattt")) // GET https://example.com/users/mattt +``` + +### Adapting and Retrying Requests + +Most web services these days are behind some sort of authentication system. One of the more common ones today is OAuth. This generally involves generating an access token authorizing your application or user to call the various supported web services. While creating these initial access tokens can be laborsome, it can be even more complicated when your access token expires and you need to fetch a new one. There are many thread-safety issues that need to be considered. + +The `RequestAdapter` and `RequestRetrier` protocols were created to make it much easier to create a thread-safe authentication system for a specific set of web services. + +#### RequestAdapter + +The `RequestAdapter` protocol allows each `Request` made on a `SessionManager` to be inspected and adapted before being created. One very specific way to use an adapter is to append an `Authorization` header to requests behind a certain type of authentication. + +```swift +class AccessTokenAdapter: RequestAdapter { + private let accessToken: String + + init(accessToken: String) { + self.accessToken = accessToken + } + + func adapt(_ urlRequest: URLRequest) throws -> URLRequest { + var urlRequest = urlRequest + + if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix("https://httpbin.org") { + urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") + } + + return urlRequest + } +} +``` + +```swift +let sessionManager = SessionManager() +sessionManager.adapter = AccessTokenAdapter(accessToken: "1234") + +sessionManager.request("https://httpbin.org/get") +``` + +#### RequestRetrier + +The `RequestRetrier` protocol allows a `Request` that encountered an `Error` while being executed to be retried. When using both the `RequestAdapter` and `RequestRetrier` protocols together, you can create credential refresh systems for OAuth1, OAuth2, Basic Auth and even exponential backoff retry policies. The possibilities are endless. Here's an example of how you could implement a refresh flow for OAuth2 access tokens. + +> **DISCLAIMER:** This is **NOT** a global `OAuth2` solution. It is merely an example demonstrating how one could use the `RequestAdapter` in conjunction with the `RequestRetrier` to create a thread-safe refresh system. + +> To reiterate, **do NOT copy** this sample code and drop it into a production application. This is merely an example. Each authentication system must be tailored to a particular platform and authentication type. + +```swift +class OAuth2Handler: RequestAdapter, RequestRetrier { + private typealias RefreshCompletion = (_ succeeded: Bool, _ accessToken: String?, _ refreshToken: String?) -> Void + + private let sessionManager: SessionManager = { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders + + return SessionManager(configuration: configuration) + }() + + private let lock = NSLock() + + private var clientID: String + private var baseURLString: String + private var accessToken: String + private var refreshToken: String + + private var isRefreshing = false + private var requestsToRetry: [RequestRetryCompletion] = [] + + // MARK: - Initialization + + public init(clientID: String, baseURLString: String, accessToken: String, refreshToken: String) { + self.clientID = clientID + self.baseURLString = baseURLString + self.accessToken = accessToken + self.refreshToken = refreshToken + } + + // MARK: - RequestAdapter + + func adapt(_ urlRequest: URLRequest) throws -> URLRequest { + if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix(baseURLString) { + var urlRequest = urlRequest + urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") + return urlRequest + } + + return urlRequest + } + + // MARK: - RequestRetrier + + func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) { + lock.lock() ; defer { lock.unlock() } + + if let response = request.task?.response as? HTTPURLResponse, response.statusCode == 401 { + requestsToRetry.append(completion) + + if !isRefreshing { + refreshTokens { [weak self] succeeded, accessToken, refreshToken in + guard let strongSelf = self else { return } + + strongSelf.lock.lock() ; defer { strongSelf.lock.unlock() } + + if let accessToken = accessToken, let refreshToken = refreshToken { + strongSelf.accessToken = accessToken + strongSelf.refreshToken = refreshToken + } + + strongSelf.requestsToRetry.forEach { $0(succeeded, 0.0) } + strongSelf.requestsToRetry.removeAll() + } + } + } else { + completion(false, 0.0) + } + } + + // MARK: - Private - Refresh Tokens + + private func refreshTokens(completion: @escaping RefreshCompletion) { + guard !isRefreshing else { return } + + isRefreshing = true + + let urlString = "\(baseURLString)/oauth2/token" + + let parameters: [String: Any] = [ + "access_token": accessToken, + "refresh_token": refreshToken, + "client_id": clientID, + "grant_type": "refresh_token" + ] + + sessionManager.request(urlString, method: .post, parameters: parameters, encoding: JSONEncoding.default) + .responseJSON { [weak self] response in + guard let strongSelf = self else { return } + + if + let json = response.result.value as? [String: Any], + let accessToken = json["access_token"] as? String, + let refreshToken = json["refresh_token"] as? String + { + completion(true, accessToken, refreshToken) + } else { + completion(false, nil, nil) + } + + strongSelf.isRefreshing = false + } + } +} +``` + +```swift +let baseURLString = "https://some.domain-behind-oauth2.com" + +let oauthHandler = OAuth2Handler( + clientID: "12345678", + baseURLString: baseURLString, + accessToken: "abcd1234", + refreshToken: "ef56789a" +) + +let sessionManager = SessionManager() +sessionManager.adapter = oauthHandler +sessionManager.retrier = oauthHandler + +let urlString = "\(baseURLString)/some/endpoint" + +sessionManager.request(urlString).validate().responseJSON { response in + debugPrint(response) +} +``` + +Once the `OAuth2Handler` is applied as both the `adapter` and `retrier` for the `SessionManager`, it will handle an invalid access token error by automatically refreshing the access token and retrying all failed requests in the same order they failed. + +> If you needed them to execute in the same order they were created, you could sort them by their task identifiers. + +The example above only checks for a `401` response code which is not nearly robust enough, but does demonstrate how one could check for an invalid access token error. In a production application, one would want to check the `realm` and most likely the `www-authenticate` header response although it depends on the OAuth2 implementation. + +Another important note is that this authentication system could be shared between multiple session managers. For example, you may need to use both a `default` and `ephemeral` session configuration for the same set of web services. The example above allows the same `oauthHandler` instance to be shared across multiple session managers to manage the single refresh flow. + +### Custom Response Serialization + +Alamofire provides built-in response serialization for data, strings, JSON, and property lists: + +```swift +Alamofire.request(...).responseData { (resp: DataResponse) in ... } +Alamofire.request(...).responseString { (resp: DataResponse) in ... } +Alamofire.request(...).responseJSON { (resp: DataResponse) in ... } +Alamofire.request(...).responsePropertyList { resp: DataResponse) in ... } +``` + +Those responses wrap deserialized *values* (Data, String, Any) or *errors* (network, validation errors), as well as *meta-data* (URL request, HTTP headers, status code, [metrics](#statistical-metrics), ...). + +You have several ways to customize all of those response elements: + +- [Response Mapping](#response-mapping) +- [Handling Errors](#handling-errors) +- [Creating a Custom Response Serializer](#creating-a-custom-response-serializer) +- [Generic Response Object Serialization](#generic-response-object-serialization) + +#### Response Mapping + +Response mapping is the simplest way to produce customized responses. It transforms the value of a response, while preserving eventual errors and meta-data. For example, you can turn a json response `DataResponse` into a response that holds an application model, such as `DataResponse`. You perform response mapping with the `DataResponse.map` method: + +```swift +Alamofire.request("https://example.com/users/mattt").responseJSON { (response: DataResponse) in + let userResponse = response.map { json in + // We assume an existing User(json: Any) initializer + return User(json: json) + } + + // Process userResponse, of type DataResponse: + if let user = userResponse.value { + print("User: { username: \(user.username), name: \(user.name) }") + } +} +``` + +When the transformation may throw an error, use `flatMap` instead: + +```swift +Alamofire.request("https://example.com/users/mattt").responseJSON { response in + let userResponse = response.flatMap { json in + try User(json: json) + } +} +``` + +Response mapping is a good fit for your custom completion handlers: + +```swift +@discardableResult +func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alamofire.DataRequest { + return Alamofire.request("https://example.com/users/mattt").responseJSON { response in + let userResponse = response.flatMap { json in + try User(json: json) + } + + completionHandler(userResponse) + } +} + +loadUser { response in + if let user = response.value { + print("User: { username: \(user.username), name: \(user.name) }") + } +} +``` + +When the map/flatMap closure may process a big amount of data, make sure you execute it outside of the main thread: + +```swift +@discardableResult +func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alamofire.DataRequest { + let utilityQueue = DispatchQueue.global(qos: .utility) + + return Alamofire.request("https://example.com/users/mattt").responseJSON(queue: utilityQueue) { response in + let userResponse = response.flatMap { json in + try User(json: json) + } + + DispatchQueue.main.async { + completionHandler(userResponse) + } + } +} +``` + +`map` and `flatMap` are also available for [download responses](#downloading-data-to-a-file). + +#### Handling Errors + +Before implementing custom response serializers or object serialization methods, it's important to consider how to handle any errors that may occur. There are two basic options: passing existing errors along unmodified, to be dealt with at response time; or, wrapping all errors in an `Error` type specific to your app. + +For example, here's a simple `BackendError` enum which will be used in later examples: + +```swift +enum BackendError: Error { + case network(error: Error) // Capture any underlying Error from the URLSession API + case dataSerialization(error: Error) + case jsonSerialization(error: Error) + case xmlSerialization(error: Error) + case objectSerialization(reason: String) +} +``` + +#### Creating a Custom Response Serializer + +Alamofire provides built-in response serialization for strings, JSON, and property lists, but others can be added in extensions on `Alamofire.DataRequest` and / or `Alamofire.DownloadRequest`. + +For example, here's how a response handler using [Ono](https://github.com/mattt/Ono) might be implemented: + +```swift +extension DataRequest { + static func xmlResponseSerializer() -> DataResponseSerializer { + return DataResponseSerializer { request, response, data, error in + // Pass through any underlying URLSession error to the .network case. + guard error == nil else { return .failure(BackendError.network(error: error!)) } + + // Use Alamofire's existing data serializer to extract the data, passing the error as nil, as it has + // already been handled. + let result = Request.serializeResponseData(response: response, data: data, error: nil) + + guard case let .success(validData) = result else { + return .failure(BackendError.dataSerialization(error: result.error! as! AFError)) + } + + do { + let xml = try ONOXMLDocument(data: validData) + return .success(xml) + } catch { + return .failure(BackendError.xmlSerialization(error: error)) + } + } + } + + @discardableResult + func responseXMLDocument( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.xmlResponseSerializer(), + completionHandler: completionHandler + ) + } +} +``` + +#### Generic Response Object Serialization + +Generics can be used to provide automatic, type-safe response object serialization. + +```swift +protocol ResponseObjectSerializable { + init?(response: HTTPURLResponse, representation: Any) +} + +extension DataRequest { + func responseObject( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + let responseSerializer = DataResponseSerializer { request, response, data, error in + guard error == nil else { return .failure(BackendError.network(error: error!)) } + + let jsonResponseSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) + let result = jsonResponseSerializer.serializeResponse(request, response, data, nil) + + guard case let .success(jsonObject) = result else { + return .failure(BackendError.jsonSerialization(error: result.error!)) + } + + guard let response = response, let responseObject = T(response: response, representation: jsonObject) else { + return .failure(BackendError.objectSerialization(reason: "JSON could not be serialized: \(jsonObject)")) + } + + return .success(responseObject) + } + + return response(queue: queue, responseSerializer: responseSerializer, completionHandler: completionHandler) + } +} +``` + +```swift +struct User: ResponseObjectSerializable, CustomStringConvertible { + let username: String + let name: String + + var description: String { + return "User: { username: \(username), name: \(name) }" + } + + init?(response: HTTPURLResponse, representation: Any) { + guard + let username = response.url?.lastPathComponent, + let representation = representation as? [String: Any], + let name = representation["name"] as? String + else { return nil } + + self.username = username + self.name = name + } +} +``` + +```swift +Alamofire.request("https://example.com/users/mattt").responseObject { (response: DataResponse) in + debugPrint(response) + + if let user = response.result.value { + print("User: { username: \(user.username), name: \(user.name) }") + } +} +``` + +The same approach can also be used to handle endpoints that return a representation of a collection of objects: + +```swift +protocol ResponseCollectionSerializable { + static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self] +} + +extension ResponseCollectionSerializable where Self: ResponseObjectSerializable { + static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self] { + var collection: [Self] = [] + + if let representation = representation as? [[String: Any]] { + for itemRepresentation in representation { + if let item = Self(response: response, representation: itemRepresentation) { + collection.append(item) + } + } + } + + return collection + } +} +``` + +```swift +extension DataRequest { + @discardableResult + func responseCollection( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DataResponse<[T]>) -> Void) -> Self + { + let responseSerializer = DataResponseSerializer<[T]> { request, response, data, error in + guard error == nil else { return .failure(BackendError.network(error: error!)) } + + let jsonSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) + let result = jsonSerializer.serializeResponse(request, response, data, nil) + + guard case let .success(jsonObject) = result else { + return .failure(BackendError.jsonSerialization(error: result.error!)) + } + + guard let response = response else { + let reason = "Response collection could not be serialized due to nil response." + return .failure(BackendError.objectSerialization(reason: reason)) + } + + return .success(T.collection(from: response, withRepresentation: jsonObject)) + } + + return response(responseSerializer: responseSerializer, completionHandler: completionHandler) + } +} +``` + +```swift +struct User: ResponseObjectSerializable, ResponseCollectionSerializable, CustomStringConvertible { + let username: String + let name: String + + var description: String { + return "User: { username: \(username), name: \(name) }" + } + + init?(response: HTTPURLResponse, representation: Any) { + guard + let username = response.url?.lastPathComponent, + let representation = representation as? [String: Any], + let name = representation["name"] as? String + else { return nil } + + self.username = username + self.name = name + } +} +``` + +```swift +Alamofire.request("https://example.com/users").responseCollection { (response: DataResponse<[User]>) in + debugPrint(response) + + if let users = response.result.value { + users.forEach { print("- \($0)") } + } +} +``` + +### Security + +Using a secure HTTPS connection when communicating with servers and web services is an important step in securing sensitive data. By default, Alamofire will evaluate the certificate chain provided by the server using Apple's built in validation provided by the Security framework. While this guarantees the certificate chain is valid, it does not prevent man-in-the-middle (MITM) attacks or other potential vulnerabilities. In order to mitigate MITM attacks, applications dealing with sensitive customer data or financial information should use certificate or public key pinning provided by the `ServerTrustPolicy`. + +#### ServerTrustPolicy + +The `ServerTrustPolicy` enumeration evaluates the server trust generally provided by an `URLAuthenticationChallenge` when connecting to a server over a secure HTTPS connection. + +```swift +let serverTrustPolicy = ServerTrustPolicy.pinCertificates( + certificates: ServerTrustPolicy.certificates(), + validateCertificateChain: true, + validateHost: true +) +``` + +There are many different cases of server trust evaluation giving you complete control over the validation process: + +* `performDefaultEvaluation`: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge. +* `pinCertificates`: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates. +* `pinPublicKeys`: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys. +* `disableEvaluation`: Disables all evaluation which in turn will always consider any server trust as valid. +* `customEvaluation`: Uses the associated closure to evaluate the validity of the server trust thus giving you complete control over the validation process. Use with caution. + +#### Server Trust Policy Manager + +The `ServerTrustPolicyManager` is responsible for storing an internal mapping of server trust policies to a particular host. This allows Alamofire to evaluate each host against a different server trust policy. + +```swift +let serverTrustPolicies: [String: ServerTrustPolicy] = [ + "test.example.com": .pinCertificates( + certificates: ServerTrustPolicy.certificates(), + validateCertificateChain: true, + validateHost: true + ), + "insecure.expired-apis.com": .disableEvaluation +] + +let sessionManager = SessionManager( + serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies) +) +``` + +> Make sure to keep a reference to the new `SessionManager` instance, otherwise your requests will all get cancelled when your `sessionManager` is deallocated. + +These server trust policies will result in the following behavior: + +- `test.example.com` will always use certificate pinning with certificate chain and host validation enabled thus requiring the following criteria to be met to allow the TLS handshake to succeed: + - Certificate chain MUST be valid. + - Certificate chain MUST include one of the pinned certificates. + - Challenge host MUST match the host in the certificate chain's leaf certificate. +- `insecure.expired-apis.com` will never evaluate the certificate chain and will always allow the TLS handshake to succeed. +- All other hosts will use the default evaluation provided by Apple. + +##### Subclassing Server Trust Policy Manager + +If you find yourself needing more flexible server trust policy matching behavior (i.e. wildcarded domains), then subclass the `ServerTrustPolicyManager` and override the `serverTrustPolicyForHost` method with your own custom implementation. + +```swift +class CustomServerTrustPolicyManager: ServerTrustPolicyManager { + override func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? { + var policy: ServerTrustPolicy? + + // Implement your custom domain matching behavior... + + return policy + } +} +``` + +#### Validating the Host + +The `.performDefaultEvaluation`, `.pinCertificates` and `.pinPublicKeys` server trust policies all take a `validateHost` parameter. Setting the value to `true` will cause the server trust evaluation to verify that hostname in the certificate matches the hostname of the challenge. If they do not match, evaluation will fail. A `validateHost` value of `false` will still evaluate the full certificate chain, but will not validate the hostname of the leaf certificate. + +> It is recommended that `validateHost` always be set to `true` in production environments. + +#### Validating the Certificate Chain + +Pinning certificates and public keys both have the option of validating the certificate chain using the `validateCertificateChain` parameter. By setting this value to `true`, the full certificate chain will be evaluated in addition to performing a byte equality check against the pinned certificates or public keys. A value of `false` will skip the certificate chain validation, but will still perform the byte equality check. + +There are several cases where it may make sense to disable certificate chain validation. The most common use cases for disabling validation are self-signed and expired certificates. The evaluation would always fail in both of these cases, but the byte equality check will still ensure you are receiving the certificate you expect from the server. + +> It is recommended that `validateCertificateChain` always be set to `true` in production environments. + +#### App Transport Security + +With the addition of App Transport Security (ATS) in iOS 9, it is possible that using a custom `ServerTrustPolicyManager` with several `ServerTrustPolicy` objects will have no effect. If you continuously see `CFNetwork SSLHandshake failed (-9806)` errors, you have probably run into this problem. Apple's ATS system overrides the entire challenge system unless you configure the ATS settings in your app's plist to disable enough of it to allow your app to evaluate the server trust. + +If you run into this problem (high probability with self-signed certificates), you can work around this issue by adding the following to your `Info.plist`. + +```xml + + NSAppTransportSecurity + + NSExceptionDomains + + example.com + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionRequiresForwardSecrecy + + NSIncludesSubdomains + + + NSTemporaryExceptionMinimumTLSVersion + TLSv1.2 + + + + +``` + +Whether you need to set the `NSExceptionRequiresForwardSecrecy` to `NO` depends on whether your TLS connection is using an allowed cipher suite. In certain cases, it will need to be set to `NO`. The `NSExceptionAllowsInsecureHTTPLoads` MUST be set to `YES` in order to allow the `SessionDelegate` to receive challenge callbacks. Once the challenge callbacks are being called, the `ServerTrustPolicyManager` will take over the server trust evaluation. You may also need to specify the `NSTemporaryExceptionMinimumTLSVersion` if you're trying to connect to a host that only supports TLS versions less than `1.2`. + +> It is recommended to always use valid certificates in production environments. + +### Network Reachability + +The `NetworkReachabilityManager` listens for reachability changes of hosts and addresses for both WWAN and WiFi network interfaces. + +```swift +let manager = NetworkReachabilityManager(host: "www.apple.com") + +manager?.listener = { status in + print("Network Status Changed: \(status)") +} + +manager?.startListening() +``` + +> Make sure to remember to retain the `manager` in the above example, or no status changes will be reported. +> Also, do not include the scheme in the `host` string or reachability won't function correctly. + +There are some important things to remember when using network reachability to determine what to do next. + +- **Do NOT** use Reachability to determine if a network request should be sent. + - You should **ALWAYS** send it. +- When Reachability is restored, use the event to retry failed network requests. + - Even though the network requests may still fail, this is a good moment to retry them. +- The network reachability status can be useful for determining why a network request may have failed. + - If a network request fails, it is more useful to tell the user that the network request failed due to being offline rather than a more technical error, such as "request timed out." + +> It is recommended to check out [WWDC 2012 Session 706, "Networking Best Practices"](https://developer.apple.com/videos/play/wwdc2012-706/) for more info. + +--- + +## Open Radars + +The following radars have some effect on the current implementation of Alamofire. + +- [`rdar://21349340`](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case +- `rdar://26870455` - Background URL Session Configurations do not work in the simulator +- `rdar://26849668` - Some URLProtocol APIs do not properly handle `URLRequest` + +## Resolved Radars + +The following radars have been resolved over time after being filed against the Alamofire project. + +- [`rdar://26761490`](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage (Resolved on 9/1/17 in Xcode 9 beta 6). + +## FAQ + +### What's the origin of the name Alamofire? + +Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas. + +### What logic belongs in a Router vs. a Request Adapter? + +Simple, static data such as paths, parameters and common headers belong in the `Router`. Dynamic data such as an `Authorization` header whose value can changed based on an authentication system belongs in a `RequestAdapter`. + +The reason the dynamic data MUST be placed into the `RequestAdapter` is to support retry operations. When a `Request` is retried, the original request is not rebuilt meaning the `Router` will not be called again. The `RequestAdapter` is called again allowing the dynamic data to be updated on the original request before retrying the `Request`. + +--- + +## Credits + +Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases. + +### Security Disclosure + +If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. + +## Donations + +The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially register as a federal non-profit organization. Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. Donating to the ASF will enable us to: + +- Pay our legal fees to register as a federal non-profit organization +- Pay our yearly legal fees to keep the non-profit in good status +- Pay for our mail servers to help us stay on top of all questions and security issues +- Potentially fund test servers to make it easier for us to test the edge cases +- Potentially fund developers to work on one of our projects full-time + +The community adoption of the ASF libraries has been amazing. We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. If you use any of our libraries for work, see if your employers would be interested in donating. Our initial goal is to raise $1000 to get all our legal ducks in a row and kickstart this campaign. Any amount you can donate today to help us reach our goal would be greatly appreciated. + +Click here to lend your support to: Alamofire Software Foundation and make a donation at pledgie.com ! + +## License + +Alamofire is released under the MIT license. [See LICENSE](https://github.com/Alamofire/Alamofire/blob/master/LICENSE) for details. diff --git a/client/Pods/Alamofire/Source/AFError.swift b/client/Pods/Alamofire/Source/AFError.swift new file mode 100644 index 00000000..585ae145 --- /dev/null +++ b/client/Pods/Alamofire/Source/AFError.swift @@ -0,0 +1,460 @@ +// +// AFError.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// `AFError` is the error type returned by Alamofire. It encompasses a few different types of errors, each with +/// their own associated reasons. +/// +/// - invalidURL: Returned when a `URLConvertible` type fails to create a valid `URL`. +/// - parameterEncodingFailed: Returned when a parameter encoding object throws an error during the encoding process. +/// - multipartEncodingFailed: Returned when some step in the multipart encoding process fails. +/// - responseValidationFailed: Returned when a `validate()` call fails. +/// - responseSerializationFailed: Returned when a response serializer encounters an error in the serialization process. +public enum AFError: Error { + /// The underlying reason the parameter encoding error occurred. + /// + /// - missingURL: The URL request did not have a URL to encode. + /// - jsonEncodingFailed: JSON serialization failed with an underlying system error during the + /// encoding process. + /// - propertyListEncodingFailed: Property list serialization failed with an underlying system error during + /// encoding process. + public enum ParameterEncodingFailureReason { + case missingURL + case jsonEncodingFailed(error: Error) + case propertyListEncodingFailed(error: Error) + } + + /// The underlying reason the multipart encoding error occurred. + /// + /// - bodyPartURLInvalid: The `fileURL` provided for reading an encodable body part isn't a + /// file URL. + /// - bodyPartFilenameInvalid: The filename of the `fileURL` provided has either an empty + /// `lastPathComponent` or `pathExtension. + /// - bodyPartFileNotReachable: The file at the `fileURL` provided was not reachable. + /// - bodyPartFileNotReachableWithError: Attempting to check the reachability of the `fileURL` provided threw + /// an error. + /// - bodyPartFileIsDirectory: The file at the `fileURL` provided is actually a directory. + /// - bodyPartFileSizeNotAvailable: The size of the file at the `fileURL` provided was not returned by + /// the system. + /// - bodyPartFileSizeQueryFailedWithError: The attempt to find the size of the file at the `fileURL` provided + /// threw an error. + /// - bodyPartInputStreamCreationFailed: An `InputStream` could not be created for the provided `fileURL`. + /// - outputStreamCreationFailed: An `OutputStream` could not be created when attempting to write the + /// encoded data to disk. + /// - outputStreamFileAlreadyExists: The encoded body data could not be writtent disk because a file + /// already exists at the provided `fileURL`. + /// - outputStreamURLInvalid: The `fileURL` provided for writing the encoded body data to disk is + /// not a file URL. + /// - outputStreamWriteFailed: The attempt to write the encoded body data to disk failed with an + /// underlying error. + /// - inputStreamReadFailed: The attempt to read an encoded body part `InputStream` failed with + /// underlying system error. + public enum MultipartEncodingFailureReason { + case bodyPartURLInvalid(url: URL) + case bodyPartFilenameInvalid(in: URL) + case bodyPartFileNotReachable(at: URL) + case bodyPartFileNotReachableWithError(atURL: URL, error: Error) + case bodyPartFileIsDirectory(at: URL) + case bodyPartFileSizeNotAvailable(at: URL) + case bodyPartFileSizeQueryFailedWithError(forURL: URL, error: Error) + case bodyPartInputStreamCreationFailed(for: URL) + + case outputStreamCreationFailed(for: URL) + case outputStreamFileAlreadyExists(at: URL) + case outputStreamURLInvalid(url: URL) + case outputStreamWriteFailed(error: Error) + + case inputStreamReadFailed(error: Error) + } + + /// The underlying reason the response validation error occurred. + /// + /// - dataFileNil: The data file containing the server response did not exist. + /// - dataFileReadFailed: The data file containing the server response could not be read. + /// - missingContentType: The response did not contain a `Content-Type` and the `acceptableContentTypes` + /// provided did not contain wildcard type. + /// - unacceptableContentType: The response `Content-Type` did not match any type in the provided + /// `acceptableContentTypes`. + /// - unacceptableStatusCode: The response status code was not acceptable. + public enum ResponseValidationFailureReason { + case dataFileNil + case dataFileReadFailed(at: URL) + case missingContentType(acceptableContentTypes: [String]) + case unacceptableContentType(acceptableContentTypes: [String], responseContentType: String) + case unacceptableStatusCode(code: Int) + } + + /// The underlying reason the response serialization error occurred. + /// + /// - inputDataNil: The server response contained no data. + /// - inputDataNilOrZeroLength: The server response contained no data or the data was zero length. + /// - inputFileNil: The file containing the server response did not exist. + /// - inputFileReadFailed: The file containing the server response could not be read. + /// - stringSerializationFailed: String serialization failed using the provided `String.Encoding`. + /// - jsonSerializationFailed: JSON serialization failed with an underlying system error. + /// - propertyListSerializationFailed: Property list serialization failed with an underlying system error. + public enum ResponseSerializationFailureReason { + case inputDataNil + case inputDataNilOrZeroLength + case inputFileNil + case inputFileReadFailed(at: URL) + case stringSerializationFailed(encoding: String.Encoding) + case jsonSerializationFailed(error: Error) + case propertyListSerializationFailed(error: Error) + } + + case invalidURL(url: URLConvertible) + case parameterEncodingFailed(reason: ParameterEncodingFailureReason) + case multipartEncodingFailed(reason: MultipartEncodingFailureReason) + case responseValidationFailed(reason: ResponseValidationFailureReason) + case responseSerializationFailed(reason: ResponseSerializationFailureReason) +} + +// MARK: - Adapt Error + +struct AdaptError: Error { + let error: Error +} + +extension Error { + var underlyingAdaptError: Error? { return (self as? AdaptError)?.error } +} + +// MARK: - Error Booleans + +extension AFError { + /// Returns whether the AFError is an invalid URL error. + public var isInvalidURLError: Bool { + if case .invalidURL = self { return true } + return false + } + + /// Returns whether the AFError is a parameter encoding error. When `true`, the `underlyingError` property will + /// contain the associated value. + public var isParameterEncodingError: Bool { + if case .parameterEncodingFailed = self { return true } + return false + } + + /// Returns whether the AFError is a multipart encoding error. When `true`, the `url` and `underlyingError` properties + /// will contain the associated values. + public var isMultipartEncodingError: Bool { + if case .multipartEncodingFailed = self { return true } + return false + } + + /// Returns whether the `AFError` is a response validation error. When `true`, the `acceptableContentTypes`, + /// `responseContentType`, and `responseCode` properties will contain the associated values. + public var isResponseValidationError: Bool { + if case .responseValidationFailed = self { return true } + return false + } + + /// Returns whether the `AFError` is a response serialization error. When `true`, the `failedStringEncoding` and + /// `underlyingError` properties will contain the associated values. + public var isResponseSerializationError: Bool { + if case .responseSerializationFailed = self { return true } + return false + } +} + +// MARK: - Convenience Properties + +extension AFError { + /// The `URLConvertible` associated with the error. + public var urlConvertible: URLConvertible? { + switch self { + case .invalidURL(let url): + return url + default: + return nil + } + } + + /// The `URL` associated with the error. + public var url: URL? { + switch self { + case .multipartEncodingFailed(let reason): + return reason.url + default: + return nil + } + } + + /// The `Error` returned by a system framework associated with a `.parameterEncodingFailed`, + /// `.multipartEncodingFailed` or `.responseSerializationFailed` error. + public var underlyingError: Error? { + switch self { + case .parameterEncodingFailed(let reason): + return reason.underlyingError + case .multipartEncodingFailed(let reason): + return reason.underlyingError + case .responseSerializationFailed(let reason): + return reason.underlyingError + default: + return nil + } + } + + /// The acceptable `Content-Type`s of a `.responseValidationFailed` error. + public var acceptableContentTypes: [String]? { + switch self { + case .responseValidationFailed(let reason): + return reason.acceptableContentTypes + default: + return nil + } + } + + /// The response `Content-Type` of a `.responseValidationFailed` error. + public var responseContentType: String? { + switch self { + case .responseValidationFailed(let reason): + return reason.responseContentType + default: + return nil + } + } + + /// The response code of a `.responseValidationFailed` error. + public var responseCode: Int? { + switch self { + case .responseValidationFailed(let reason): + return reason.responseCode + default: + return nil + } + } + + /// The `String.Encoding` associated with a failed `.stringResponse()` call. + public var failedStringEncoding: String.Encoding? { + switch self { + case .responseSerializationFailed(let reason): + return reason.failedStringEncoding + default: + return nil + } + } +} + +extension AFError.ParameterEncodingFailureReason { + var underlyingError: Error? { + switch self { + case .jsonEncodingFailed(let error), .propertyListEncodingFailed(let error): + return error + default: + return nil + } + } +} + +extension AFError.MultipartEncodingFailureReason { + var url: URL? { + switch self { + case .bodyPartURLInvalid(let url), .bodyPartFilenameInvalid(let url), .bodyPartFileNotReachable(let url), + .bodyPartFileIsDirectory(let url), .bodyPartFileSizeNotAvailable(let url), + .bodyPartInputStreamCreationFailed(let url), .outputStreamCreationFailed(let url), + .outputStreamFileAlreadyExists(let url), .outputStreamURLInvalid(let url), + .bodyPartFileNotReachableWithError(let url, _), .bodyPartFileSizeQueryFailedWithError(let url, _): + return url + default: + return nil + } + } + + var underlyingError: Error? { + switch self { + case .bodyPartFileNotReachableWithError(_, let error), .bodyPartFileSizeQueryFailedWithError(_, let error), + .outputStreamWriteFailed(let error), .inputStreamReadFailed(let error): + return error + default: + return nil + } + } +} + +extension AFError.ResponseValidationFailureReason { + var acceptableContentTypes: [String]? { + switch self { + case .missingContentType(let types), .unacceptableContentType(let types, _): + return types + default: + return nil + } + } + + var responseContentType: String? { + switch self { + case .unacceptableContentType(_, let responseType): + return responseType + default: + return nil + } + } + + var responseCode: Int? { + switch self { + case .unacceptableStatusCode(let code): + return code + default: + return nil + } + } +} + +extension AFError.ResponseSerializationFailureReason { + var failedStringEncoding: String.Encoding? { + switch self { + case .stringSerializationFailed(let encoding): + return encoding + default: + return nil + } + } + + var underlyingError: Error? { + switch self { + case .jsonSerializationFailed(let error), .propertyListSerializationFailed(let error): + return error + default: + return nil + } + } +} + +// MARK: - Error Descriptions + +extension AFError: LocalizedError { + public var errorDescription: String? { + switch self { + case .invalidURL(let url): + return "URL is not valid: \(url)" + case .parameterEncodingFailed(let reason): + return reason.localizedDescription + case .multipartEncodingFailed(let reason): + return reason.localizedDescription + case .responseValidationFailed(let reason): + return reason.localizedDescription + case .responseSerializationFailed(let reason): + return reason.localizedDescription + } + } +} + +extension AFError.ParameterEncodingFailureReason { + var localizedDescription: String { + switch self { + case .missingURL: + return "URL request to encode was missing a URL" + case .jsonEncodingFailed(let error): + return "JSON could not be encoded because of error:\n\(error.localizedDescription)" + case .propertyListEncodingFailed(let error): + return "PropertyList could not be encoded because of error:\n\(error.localizedDescription)" + } + } +} + +extension AFError.MultipartEncodingFailureReason { + var localizedDescription: String { + switch self { + case .bodyPartURLInvalid(let url): + return "The URL provided is not a file URL: \(url)" + case .bodyPartFilenameInvalid(let url): + return "The URL provided does not have a valid filename: \(url)" + case .bodyPartFileNotReachable(let url): + return "The URL provided is not reachable: \(url)" + case .bodyPartFileNotReachableWithError(let url, let error): + return ( + "The system returned an error while checking the provided URL for " + + "reachability.\nURL: \(url)\nError: \(error)" + ) + case .bodyPartFileIsDirectory(let url): + return "The URL provided is a directory: \(url)" + case .bodyPartFileSizeNotAvailable(let url): + return "Could not fetch the file size from the provided URL: \(url)" + case .bodyPartFileSizeQueryFailedWithError(let url, let error): + return ( + "The system returned an error while attempting to fetch the file size from the " + + "provided URL.\nURL: \(url)\nError: \(error)" + ) + case .bodyPartInputStreamCreationFailed(let url): + return "Failed to create an InputStream for the provided URL: \(url)" + case .outputStreamCreationFailed(let url): + return "Failed to create an OutputStream for URL: \(url)" + case .outputStreamFileAlreadyExists(let url): + return "A file already exists at the provided URL: \(url)" + case .outputStreamURLInvalid(let url): + return "The provided OutputStream URL is invalid: \(url)" + case .outputStreamWriteFailed(let error): + return "OutputStream write failed with error: \(error)" + case .inputStreamReadFailed(let error): + return "InputStream read failed with error: \(error)" + } + } +} + +extension AFError.ResponseSerializationFailureReason { + var localizedDescription: String { + switch self { + case .inputDataNil: + return "Response could not be serialized, input data was nil." + case .inputDataNilOrZeroLength: + return "Response could not be serialized, input data was nil or zero length." + case .inputFileNil: + return "Response could not be serialized, input file was nil." + case .inputFileReadFailed(let url): + return "Response could not be serialized, input file could not be read: \(url)." + case .stringSerializationFailed(let encoding): + return "String could not be serialized with encoding: \(encoding)." + case .jsonSerializationFailed(let error): + return "JSON could not be serialized because of error:\n\(error.localizedDescription)" + case .propertyListSerializationFailed(let error): + return "PropertyList could not be serialized because of error:\n\(error.localizedDescription)" + } + } +} + +extension AFError.ResponseValidationFailureReason { + var localizedDescription: String { + switch self { + case .dataFileNil: + return "Response could not be validated, data file was nil." + case .dataFileReadFailed(let url): + return "Response could not be validated, data file could not be read: \(url)." + case .missingContentType(let types): + return ( + "Response Content-Type was missing and acceptable content types " + + "(\(types.joined(separator: ","))) do not match \"*/*\"." + ) + case .unacceptableContentType(let acceptableTypes, let responseType): + return ( + "Response Content-Type \"\(responseType)\" does not match any acceptable types: " + + "\(acceptableTypes.joined(separator: ","))." + ) + case .unacceptableStatusCode(let code): + return "Response status code was unacceptable: \(code)." + } + } +} diff --git a/client/Pods/Alamofire/Source/Alamofire.swift b/client/Pods/Alamofire/Source/Alamofire.swift new file mode 100644 index 00000000..e9716131 --- /dev/null +++ b/client/Pods/Alamofire/Source/Alamofire.swift @@ -0,0 +1,465 @@ +// +// Alamofire.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct +/// URL requests. +public protocol URLConvertible { + /// Returns a URL that conforms to RFC 2396 or throws an `Error`. + /// + /// - throws: An `Error` if the type cannot be converted to a `URL`. + /// + /// - returns: A URL or throws an `Error`. + func asURL() throws -> URL +} + +extension String: URLConvertible { + /// Returns a URL if `self` represents a valid URL string that conforms to RFC 2396 or throws an `AFError`. + /// + /// - throws: An `AFError.invalidURL` if `self` is not a valid URL string. + /// + /// - returns: A URL or throws an `AFError`. + public func asURL() throws -> URL { + guard let url = URL(string: self) else { throw AFError.invalidURL(url: self) } + return url + } +} + +extension URL: URLConvertible { + /// Returns self. + public func asURL() throws -> URL { return self } +} + +extension URLComponents: URLConvertible { + /// Returns a URL if `url` is not nil, otherwise throws an `Error`. + /// + /// - throws: An `AFError.invalidURL` if `url` is `nil`. + /// + /// - returns: A URL or throws an `AFError`. + public func asURL() throws -> URL { + guard let url = url else { throw AFError.invalidURL(url: self) } + return url + } +} + +// MARK: - + +/// Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. +public protocol URLRequestConvertible { + /// Returns a URL request or throws if an `Error` was encountered. + /// + /// - throws: An `Error` if the underlying `URLRequest` is `nil`. + /// + /// - returns: A URL request. + func asURLRequest() throws -> URLRequest +} + +extension URLRequestConvertible { + /// The URL request. + public var urlRequest: URLRequest? { return try? asURLRequest() } +} + +extension URLRequest: URLRequestConvertible { + /// Returns a URL request or throws if an `Error` was encountered. + public func asURLRequest() throws -> URLRequest { return self } +} + +// MARK: - + +extension URLRequest { + /// Creates an instance with the specified `method`, `urlString` and `headers`. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The new `URLRequest` instance. + public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws { + let url = try url.asURL() + + self.init(url: url) + + httpMethod = method.rawValue + + if let headers = headers { + for (headerField, headerValue) in headers { + setValue(headerValue, forHTTPHeaderField: headerField) + } + } + } + + func adapt(using adapter: RequestAdapter?) throws -> URLRequest { + guard let adapter = adapter else { return self } + return try adapter.adapt(self) + } +} + +// MARK: - Data Request + +/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, +/// `method`, `parameters`, `encoding` and `headers`. +/// +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.get` by default. +/// - parameter parameters: The parameters. `nil` by default. +/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `DataRequest`. +@discardableResult +public func request( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil) + -> DataRequest +{ + return SessionManager.default.request( + url, + method: method, + parameters: parameters, + encoding: encoding, + headers: headers + ) +} + +/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of a URL based on the +/// specified `urlRequest`. +/// +/// - parameter urlRequest: The URL request +/// +/// - returns: The created `DataRequest`. +@discardableResult +public func request(_ urlRequest: URLRequestConvertible) -> DataRequest { + return SessionManager.default.request(urlRequest) +} + +// MARK: - Download Request + +// MARK: URL Request + +/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, +/// `method`, `parameters`, `encoding`, `headers` and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.get` by default. +/// - parameter parameters: The parameters. `nil` by default. +/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download( + url, + method: method, + parameters: parameters, + encoding: encoding, + headers: headers, + to: destination + ) +} + +/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of a URL based on the +/// specified `urlRequest` and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// - parameter urlRequest: The URL request. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + _ urlRequest: URLRequestConvertible, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download(urlRequest, to: destination) +} + +// MARK: Resume Data + +/// Creates a `DownloadRequest` using the default `SessionManager` from the `resumeData` produced from a +/// previous request cancellation to retrieve the contents of the original request and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken +/// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the +/// data is written incorrectly and will always fail to resume the download. For more information about the bug and +/// possible workarounds, please refer to the following Stack Overflow post: +/// +/// - http://stackoverflow.com/a/39347461/1342462 +/// +/// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` +/// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for additional +/// information. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + resumingWith resumeData: Data, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download(resumingWith: resumeData, to: destination) +} + +// MARK: - Upload Request + +// MARK: File + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `file`. +/// +/// - parameter file: The file to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ fileURL: URL, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(fileURL, to: url, method: method, headers: headers) +} + +/// Creates a `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `file`. +/// +/// - parameter file: The file to upload. +/// - parameter urlRequest: The URL request. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(fileURL, with: urlRequest) +} + +// MARK: Data + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `data`. +/// +/// - parameter data: The data to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ data: Data, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(data, to: url, method: method, headers: headers) +} + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `data`. +/// +/// - parameter data: The data to upload. +/// - parameter urlRequest: The URL request. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(data, with: urlRequest) +} + +// MARK: InputStream + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `stream`. +/// +/// - parameter stream: The stream to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ stream: InputStream, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(stream, to: url, method: method, headers: headers) +} + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `stream`. +/// +/// - parameter urlRequest: The URL request. +/// - parameter stream: The stream to upload. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(stream, with: urlRequest) +} + +// MARK: MultipartFormData + +/// Encodes `multipartFormData` using `encodingMemoryThreshold` with the default `SessionManager` and calls +/// `encodingCompletion` with new `UploadRequest` using the `url`, `method` and `headers`. +/// +/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative +/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most +/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to +/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory +/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be +/// used for larger payloads such as video content. +/// +/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory +/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, +/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk +/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding +/// technique was used. +/// +/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. +/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. +/// `multipartFormDataEncodingMemoryThreshold` by default. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. +public func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil, + encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) +{ + return SessionManager.default.upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + to: url, + method: method, + headers: headers, + encodingCompletion: encodingCompletion + ) +} + +/// Encodes `multipartFormData` using `encodingMemoryThreshold` and the default `SessionManager` and +/// calls `encodingCompletion` with new `UploadRequest` using the `urlRequest`. +/// +/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative +/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most +/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to +/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory +/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be +/// used for larger payloads such as video content. +/// +/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory +/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, +/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk +/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding +/// technique was used. +/// +/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. +/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. +/// `multipartFormDataEncodingMemoryThreshold` by default. +/// - parameter urlRequest: The URL request. +/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. +public func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + with urlRequest: URLRequestConvertible, + encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) +{ + return SessionManager.default.upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + with: urlRequest, + encodingCompletion: encodingCompletion + ) +} + +#if !os(watchOS) + +// MARK: - Stream Request + +// MARK: Hostname and Port + +/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `hostname` +/// and `port`. +/// +/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. +/// +/// - parameter hostName: The hostname of the server to connect to. +/// - parameter port: The port of the server to connect to. +/// +/// - returns: The created `StreamRequest`. +@discardableResult +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +public func stream(withHostName hostName: String, port: Int) -> StreamRequest { + return SessionManager.default.stream(withHostName: hostName, port: port) +} + +// MARK: NetService + +/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `netService`. +/// +/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. +/// +/// - parameter netService: The net service used to identify the endpoint. +/// +/// - returns: The created `StreamRequest`. +@discardableResult +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +public func stream(with netService: NetService) -> StreamRequest { + return SessionManager.default.stream(with: netService) +} + +#endif diff --git a/client/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/client/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift new file mode 100644 index 00000000..90313956 --- /dev/null +++ b/client/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift @@ -0,0 +1,37 @@ +// +// DispatchQueue+Alamofire.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Dispatch +import Foundation + +extension DispatchQueue { + static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } + static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } + static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } + static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } + + func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { + asyncAfter(deadline: .now() + delay, execute: closure) + } +} diff --git a/client/Pods/Alamofire/Source/MultipartFormData.swift b/client/Pods/Alamofire/Source/MultipartFormData.swift new file mode 100644 index 00000000..ba02d24f --- /dev/null +++ b/client/Pods/Alamofire/Source/MultipartFormData.swift @@ -0,0 +1,580 @@ +// +// MultipartFormData.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +#if os(iOS) || os(watchOS) || os(tvOS) +import MobileCoreServices +#elseif os(macOS) +import CoreServices +#endif + +/// Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode +/// multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead +/// to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the +/// data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for +/// larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset. +/// +/// For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well +/// and the w3 form documentation. +/// +/// - https://www.ietf.org/rfc/rfc2388.txt +/// - https://www.ietf.org/rfc/rfc2045.txt +/// - https://www.w3.org/TR/html401/interact/forms.html#h-17.13 +open class MultipartFormData { + + // MARK: - Helper Types + + struct EncodingCharacters { + static let crlf = "\r\n" + } + + struct BoundaryGenerator { + enum BoundaryType { + case initial, encapsulated, final + } + + static func randomBoundary() -> String { + return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random()) + } + + static func boundaryData(forBoundaryType boundaryType: BoundaryType, boundary: String) -> Data { + let boundaryText: String + + switch boundaryType { + case .initial: + boundaryText = "--\(boundary)\(EncodingCharacters.crlf)" + case .encapsulated: + boundaryText = "\(EncodingCharacters.crlf)--\(boundary)\(EncodingCharacters.crlf)" + case .final: + boundaryText = "\(EncodingCharacters.crlf)--\(boundary)--\(EncodingCharacters.crlf)" + } + + return boundaryText.data(using: String.Encoding.utf8, allowLossyConversion: false)! + } + } + + class BodyPart { + let headers: HTTPHeaders + let bodyStream: InputStream + let bodyContentLength: UInt64 + var hasInitialBoundary = false + var hasFinalBoundary = false + + init(headers: HTTPHeaders, bodyStream: InputStream, bodyContentLength: UInt64) { + self.headers = headers + self.bodyStream = bodyStream + self.bodyContentLength = bodyContentLength + } + } + + // MARK: - Properties + + /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. + open lazy var contentType: String = "multipart/form-data; boundary=\(self.boundary)" + + /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. + public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } + + /// The boundary used to separate the body parts in the encoded form data. + public let boundary: String + + private var bodyParts: [BodyPart] + private var bodyPartError: AFError? + private let streamBufferSize: Int + + // MARK: - Lifecycle + + /// Creates a multipart form data object. + /// + /// - returns: The multipart form data object. + public init() { + self.boundary = BoundaryGenerator.randomBoundary() + self.bodyParts = [] + + /// + /// The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more + /// information, please refer to the following article: + /// - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html + /// + + self.streamBufferSize = 1024 + } + + // MARK: - Body Parts + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) + /// - Encoded data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + public func append(_ data: Data, withName name: String) { + let headers = contentHeaders(withName: name) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) + /// - `Content-Type: #{generated mimeType}` (HTTP Header) + /// - Encoded data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header. + public func append(_ data: Data, withName name: String, mimeType: String) { + let headers = contentHeaders(withName: name, mimeType: mimeType) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) + /// - `Content-Type: #{mimeType}` (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header. + public func append(_ data: Data, withName name: String, fileName: String, mimeType: String) { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the file and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header) + /// - `Content-Type: #{generated mimeType}` (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// The filename in the `Content-Disposition` HTTP header is generated from the last path component of the + /// `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the + /// system associated MIME type. + /// + /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. + /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. + public func append(_ fileURL: URL, withName name: String) { + let fileName = fileURL.lastPathComponent + let pathExtension = fileURL.pathExtension + + if !fileName.isEmpty && !pathExtension.isEmpty { + let mime = mimeType(forPathExtension: pathExtension) + append(fileURL, withName: name, fileName: fileName, mimeType: mime) + } else { + setBodyPartError(withReason: .bodyPartFilenameInvalid(in: fileURL)) + } + } + + /// Creates a body part from the file and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header) + /// - Content-Type: #{mimeType} (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. + /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header. + public func append(_ fileURL: URL, withName name: String, fileName: String, mimeType: String) { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + + //============================================================ + // Check 1 - is file URL? + //============================================================ + + guard fileURL.isFileURL else { + setBodyPartError(withReason: .bodyPartURLInvalid(url: fileURL)) + return + } + + //============================================================ + // Check 2 - is file URL reachable? + //============================================================ + + do { + let isReachable = try fileURL.checkPromisedItemIsReachable() + guard isReachable else { + setBodyPartError(withReason: .bodyPartFileNotReachable(at: fileURL)) + return + } + } catch { + setBodyPartError(withReason: .bodyPartFileNotReachableWithError(atURL: fileURL, error: error)) + return + } + + //============================================================ + // Check 3 - is file URL a directory? + //============================================================ + + var isDirectory: ObjCBool = false + let path = fileURL.path + + guard FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) && !isDirectory.boolValue else { + setBodyPartError(withReason: .bodyPartFileIsDirectory(at: fileURL)) + return + } + + //============================================================ + // Check 4 - can the file size be extracted? + //============================================================ + + let bodyContentLength: UInt64 + + do { + guard let fileSize = try FileManager.default.attributesOfItem(atPath: path)[.size] as? NSNumber else { + setBodyPartError(withReason: .bodyPartFileSizeNotAvailable(at: fileURL)) + return + } + + bodyContentLength = fileSize.uint64Value + } + catch { + setBodyPartError(withReason: .bodyPartFileSizeQueryFailedWithError(forURL: fileURL, error: error)) + return + } + + //============================================================ + // Check 5 - can a stream be created from file URL? + //============================================================ + + guard let stream = InputStream(url: fileURL) else { + setBodyPartError(withReason: .bodyPartInputStreamCreationFailed(for: fileURL)) + return + } + + append(stream, withLength: bodyContentLength, headers: headers) + } + + /// Creates a body part from the stream and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) + /// - `Content-Type: #{mimeType}` (HTTP Header) + /// - Encoded stream data + /// - Multipart form boundary + /// + /// - parameter stream: The input stream to encode in the multipart form data. + /// - parameter length: The content length of the stream. + /// - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header. + public func append( + _ stream: InputStream, + withLength length: UInt64, + name: String, + fileName: String, + mimeType: String) + { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part with the headers, stream and length and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - HTTP headers + /// - Encoded stream data + /// - Multipart form boundary + /// + /// - parameter stream: The input stream to encode in the multipart form data. + /// - parameter length: The content length of the stream. + /// - parameter headers: The HTTP headers for the body part. + public func append(_ stream: InputStream, withLength length: UInt64, headers: HTTPHeaders) { + let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length) + bodyParts.append(bodyPart) + } + + // MARK: - Data Encoding + + /// Encodes all the appended body parts into a single `Data` value. + /// + /// It is important to note that this method will load all the appended body parts into memory all at the same + /// time. This method should only be used when the encoded data will have a small memory footprint. For large data + /// cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method. + /// + /// - throws: An `AFError` if encoding encounters an error. + /// + /// - returns: The encoded `Data` if encoding is successful. + public func encode() throws -> Data { + if let bodyPartError = bodyPartError { + throw bodyPartError + } + + var encoded = Data() + + bodyParts.first?.hasInitialBoundary = true + bodyParts.last?.hasFinalBoundary = true + + for bodyPart in bodyParts { + let encodedData = try encode(bodyPart) + encoded.append(encodedData) + } + + return encoded + } + + /// Writes the appended body parts into the given file URL. + /// + /// This process is facilitated by reading and writing with input and output streams, respectively. Thus, + /// this approach is very memory efficient and should be used for large body part data. + /// + /// - parameter fileURL: The file URL to write the multipart form data into. + /// + /// - throws: An `AFError` if encoding encounters an error. + public func writeEncodedData(to fileURL: URL) throws { + if let bodyPartError = bodyPartError { + throw bodyPartError + } + + if FileManager.default.fileExists(atPath: fileURL.path) { + throw AFError.multipartEncodingFailed(reason: .outputStreamFileAlreadyExists(at: fileURL)) + } else if !fileURL.isFileURL { + throw AFError.multipartEncodingFailed(reason: .outputStreamURLInvalid(url: fileURL)) + } + + guard let outputStream = OutputStream(url: fileURL, append: false) else { + throw AFError.multipartEncodingFailed(reason: .outputStreamCreationFailed(for: fileURL)) + } + + outputStream.open() + defer { outputStream.close() } + + self.bodyParts.first?.hasInitialBoundary = true + self.bodyParts.last?.hasFinalBoundary = true + + for bodyPart in self.bodyParts { + try write(bodyPart, to: outputStream) + } + } + + // MARK: - Private - Body Part Encoding + + private func encode(_ bodyPart: BodyPart) throws -> Data { + var encoded = Data() + + let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() + encoded.append(initialData) + + let headerData = encodeHeaders(for: bodyPart) + encoded.append(headerData) + + let bodyStreamData = try encodeBodyStream(for: bodyPart) + encoded.append(bodyStreamData) + + if bodyPart.hasFinalBoundary { + encoded.append(finalBoundaryData()) + } + + return encoded + } + + private func encodeHeaders(for bodyPart: BodyPart) -> Data { + var headerText = "" + + for (key, value) in bodyPart.headers { + headerText += "\(key): \(value)\(EncodingCharacters.crlf)" + } + headerText += EncodingCharacters.crlf + + return headerText.data(using: String.Encoding.utf8, allowLossyConversion: false)! + } + + private func encodeBodyStream(for bodyPart: BodyPart) throws -> Data { + let inputStream = bodyPart.bodyStream + inputStream.open() + defer { inputStream.close() } + + var encoded = Data() + + while inputStream.hasBytesAvailable { + var buffer = [UInt8](repeating: 0, count: streamBufferSize) + let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) + + if let error = inputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: error)) + } + + if bytesRead > 0 { + encoded.append(buffer, count: bytesRead) + } else { + break + } + } + + return encoded + } + + // MARK: - Private - Writing Body Part to Output Stream + + private func write(_ bodyPart: BodyPart, to outputStream: OutputStream) throws { + try writeInitialBoundaryData(for: bodyPart, to: outputStream) + try writeHeaderData(for: bodyPart, to: outputStream) + try writeBodyStream(for: bodyPart, to: outputStream) + try writeFinalBoundaryData(for: bodyPart, to: outputStream) + } + + private func writeInitialBoundaryData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() + return try write(initialData, to: outputStream) + } + + private func writeHeaderData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let headerData = encodeHeaders(for: bodyPart) + return try write(headerData, to: outputStream) + } + + private func writeBodyStream(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let inputStream = bodyPart.bodyStream + + inputStream.open() + defer { inputStream.close() } + + while inputStream.hasBytesAvailable { + var buffer = [UInt8](repeating: 0, count: streamBufferSize) + let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) + + if let streamError = inputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: streamError)) + } + + if bytesRead > 0 { + if buffer.count != bytesRead { + buffer = Array(buffer[0.. 0, outputStream.hasSpaceAvailable { + let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite) + + if let error = outputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .outputStreamWriteFailed(error: error)) + } + + bytesToWrite -= bytesWritten + + if bytesToWrite > 0 { + buffer = Array(buffer[bytesWritten.. String { + if + let id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as CFString, nil)?.takeRetainedValue(), + let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue() + { + return contentType as String + } + + return "application/octet-stream" + } + + // MARK: - Private - Content Headers + + private func contentHeaders(withName name: String, fileName: String? = nil, mimeType: String? = nil) -> [String: String] { + var disposition = "form-data; name=\"\(name)\"" + if let fileName = fileName { disposition += "; filename=\"\(fileName)\"" } + + var headers = ["Content-Disposition": disposition] + if let mimeType = mimeType { headers["Content-Type"] = mimeType } + + return headers + } + + // MARK: - Private - Boundary Encoding + + private func initialBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .initial, boundary: boundary) + } + + private func encapsulatedBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .encapsulated, boundary: boundary) + } + + private func finalBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .final, boundary: boundary) + } + + // MARK: - Private - Errors + + private func setBodyPartError(withReason reason: AFError.MultipartEncodingFailureReason) { + guard bodyPartError == nil else { return } + bodyPartError = AFError.multipartEncodingFailed(reason: reason) + } +} diff --git a/client/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/client/Pods/Alamofire/Source/NetworkReachabilityManager.swift new file mode 100644 index 00000000..cdb5a02d --- /dev/null +++ b/client/Pods/Alamofire/Source/NetworkReachabilityManager.swift @@ -0,0 +1,233 @@ +// +// NetworkReachabilityManager.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#if !os(watchOS) + +import Foundation +import SystemConfiguration + +/// The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and +/// WiFi network interfaces. +/// +/// Reachability can be used to determine background information about why a network operation failed, or to retry +/// network requests 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. +public class NetworkReachabilityManager { + /// Defines the various states of network reachability. + /// + /// - unknown: It is unknown whether the network is reachable. + /// - notReachable: The network is not reachable. + /// - reachable: The network is reachable. + public enum NetworkReachabilityStatus { + case unknown + case notReachable + case reachable(ConnectionType) + } + + /// Defines the various connection types detected by reachability flags. + /// + /// - ethernetOrWiFi: The connection type is either over Ethernet or WiFi. + /// - wwan: The connection type is a WWAN connection. + public enum ConnectionType { + case ethernetOrWiFi + case wwan + } + + /// A closure executed when the network reachability status changes. The closure takes a single argument: the + /// network reachability status. + public typealias Listener = (NetworkReachabilityStatus) -> Void + + // MARK: - Properties + + /// Whether the network is currently reachable. + public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi } + + /// Whether the network is currently reachable over the WWAN interface. + public var isReachableOnWWAN: Bool { return networkReachabilityStatus == .reachable(.wwan) } + + /// Whether the network is currently reachable over Ethernet or WiFi interface. + public var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .reachable(.ethernetOrWiFi) } + + /// The current network reachability status. + public var networkReachabilityStatus: NetworkReachabilityStatus { + guard let flags = self.flags else { return .unknown } + return networkReachabilityStatusForFlags(flags) + } + + /// The dispatch queue to execute the `listener` closure on. + public var listenerQueue: DispatchQueue = DispatchQueue.main + + /// A closure executed when the network reachability status changes. + public var listener: Listener? + + private var flags: SCNetworkReachabilityFlags? { + var flags = SCNetworkReachabilityFlags() + + if SCNetworkReachabilityGetFlags(reachability, &flags) { + return flags + } + + return nil + } + + private let reachability: SCNetworkReachability + private var previousFlags: SCNetworkReachabilityFlags + + // MARK: - Initialization + + /// Creates a `NetworkReachabilityManager` instance with the specified host. + /// + /// - parameter host: The host used to evaluate network reachability. + /// + /// - returns: The new `NetworkReachabilityManager` instance. + public convenience init?(host: String) { + guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil } + self.init(reachability: reachability) + } + + /// Creates a `NetworkReachabilityManager` instance that monitors the address 0.0.0.0. + /// + /// Reachability treats the 0.0.0.0 address as a special token that causes it to monitor the general routing + /// status of the device, both IPv4 and IPv6. + /// + /// - returns: The new `NetworkReachabilityManager` instance. + public convenience init?() { + var address = sockaddr_in() + address.sin_len = UInt8(MemoryLayout.size) + address.sin_family = sa_family_t(AF_INET) + + guard let reachability = withUnsafePointer(to: &address, { pointer in + return pointer.withMemoryRebound(to: sockaddr.self, capacity: MemoryLayout.size) { + return SCNetworkReachabilityCreateWithAddress(nil, $0) + } + }) else { return nil } + + self.init(reachability: reachability) + } + + private init(reachability: SCNetworkReachability) { + self.reachability = reachability + self.previousFlags = SCNetworkReachabilityFlags() + } + + deinit { + stopListening() + } + + // MARK: - Listening + + /// Starts listening for changes in network reachability status. + /// + /// - returns: `true` if listening was started successfully, `false` otherwise. + @discardableResult + public func startListening() -> Bool { + var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) + context.info = Unmanaged.passUnretained(self).toOpaque() + + let callbackEnabled = SCNetworkReachabilitySetCallback( + reachability, + { (_, flags, info) in + let reachability = Unmanaged.fromOpaque(info!).takeUnretainedValue() + reachability.notifyListener(flags) + }, + &context + ) + + let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue) + + listenerQueue.async { + self.previousFlags = SCNetworkReachabilityFlags() + self.notifyListener(self.flags ?? SCNetworkReachabilityFlags()) + } + + return callbackEnabled && queueEnabled + } + + /// Stops listening for changes in network reachability status. + public func stopListening() { + SCNetworkReachabilitySetCallback(reachability, nil, nil) + SCNetworkReachabilitySetDispatchQueue(reachability, nil) + } + + // MARK: - Internal - Listener Notification + + func notifyListener(_ flags: SCNetworkReachabilityFlags) { + guard previousFlags != flags else { return } + previousFlags = flags + + listener?(networkReachabilityStatusForFlags(flags)) + } + + // MARK: - Internal - Network Reachability Status + + func networkReachabilityStatusForFlags(_ flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { + guard isNetworkReachable(with: flags) else { return .notReachable } + + var networkStatus: NetworkReachabilityStatus = .reachable(.ethernetOrWiFi) + + #if os(iOS) + if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } + #endif + + return networkStatus + } + + func isNetworkReachable(with flags: SCNetworkReachabilityFlags) -> Bool { + let isReachable = flags.contains(.reachable) + let needsConnection = flags.contains(.connectionRequired) + let canConnectAutomatically = flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) + let canConnectWithoutUserInteraction = canConnectAutomatically && !flags.contains(.interventionRequired) + + return isReachable && (!needsConnection || canConnectWithoutUserInteraction) + } +} + +// MARK: - + +extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {} + +/// Returns whether the two network reachability status values are equal. +/// +/// - parameter lhs: The left-hand side value to compare. +/// - parameter rhs: The right-hand side value to compare. +/// +/// - returns: `true` if the two values are equal, `false` otherwise. +public func ==( + lhs: NetworkReachabilityManager.NetworkReachabilityStatus, + rhs: NetworkReachabilityManager.NetworkReachabilityStatus) + -> Bool +{ + switch (lhs, rhs) { + case (.unknown, .unknown): + return true + case (.notReachable, .notReachable): + return true + case let (.reachable(lhsConnectionType), .reachable(rhsConnectionType)): + return lhsConnectionType == rhsConnectionType + default: + return false + } +} + +#endif diff --git a/client/Pods/Alamofire/Source/Notifications.swift b/client/Pods/Alamofire/Source/Notifications.swift new file mode 100644 index 00000000..df41505d --- /dev/null +++ b/client/Pods/Alamofire/Source/Notifications.swift @@ -0,0 +1,52 @@ +// +// Notifications.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +extension Notification.Name { + /// Used as a namespace for all `URLSessionTask` related notifications. + public struct Task { + /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`. + public static let DidResume = Notification.Name(rawValue: "org.alamofire.notification.name.task.didResume") + + /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`. + public static let DidSuspend = Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend") + + /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`. + public static let DidCancel = Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel") + + /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`. + public static let DidComplete = Notification.Name(rawValue: "org.alamofire.notification.name.task.didComplete") + } +} + +// MARK: - + +extension Notification { + /// Used as a namespace for all `Notification` user info dictionary keys. + public struct Key { + /// User info dictionary key representing the `URLSessionTask` associated with the notification. + public static let Task = "org.alamofire.notification.key.task" + } +} diff --git a/client/Pods/Alamofire/Source/ParameterEncoding.swift b/client/Pods/Alamofire/Source/ParameterEncoding.swift new file mode 100644 index 00000000..dabb5622 --- /dev/null +++ b/client/Pods/Alamofire/Source/ParameterEncoding.swift @@ -0,0 +1,432 @@ +// +// ParameterEncoding.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// HTTP method definitions. +/// +/// See https://tools.ietf.org/html/rfc7231#section-4.3 +public enum HTTPMethod: String { + case options = "OPTIONS" + case get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case trace = "TRACE" + case connect = "CONNECT" +} + +// MARK: - + +/// A dictionary of parameters to apply to a `URLRequest`. +public typealias Parameters = [String: Any] + +/// A type used to define how a set of parameters are applied to a `URLRequest`. +public protocol ParameterEncoding { + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `AFError.parameterEncodingFailed` error if encoding fails. + /// + /// - returns: The encoded request. + func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest +} + +// MARK: - + +/// Creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP +/// body of the URL request. Whether the query string is set or appended to any existing URL query string or set as +/// the HTTP body depends on the destination of the encoding. +/// +/// The `Content-Type` HTTP header field of an encoded request with HTTP body is set to +/// `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification for how to encode +/// collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending +/// the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`). +public struct URLEncoding: ParameterEncoding { + + // MARK: Helper Types + + /// Defines whether the url-encoded query string is applied to the existing query string or HTTP body of the + /// resulting URL request. + /// + /// - methodDependent: Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` + /// requests and sets as the HTTP body for requests with any other HTTP method. + /// - queryString: Sets or appends encoded query string result to existing query string. + /// - httpBody: Sets encoded query string result as the HTTP body of the URL request. + public enum Destination { + case methodDependent, queryString, httpBody + } + + // MARK: Properties + + /// Returns a default `URLEncoding` instance. + public static var `default`: URLEncoding { return URLEncoding() } + + /// Returns a `URLEncoding` instance with a `.methodDependent` destination. + public static var methodDependent: URLEncoding { return URLEncoding() } + + /// Returns a `URLEncoding` instance with a `.queryString` destination. + public static var queryString: URLEncoding { return URLEncoding(destination: .queryString) } + + /// Returns a `URLEncoding` instance with an `.httpBody` destination. + public static var httpBody: URLEncoding { return URLEncoding(destination: .httpBody) } + + /// The destination defining where the encoded query string is to be applied to the URL request. + public let destination: Destination + + // MARK: Initialization + + /// Creates a `URLEncoding` instance using the specified destination. + /// + /// - parameter destination: The destination defining where the encoded query string is to be applied. + /// + /// - returns: The new `URLEncoding` instance. + public init(destination: Destination = .methodDependent) { + self.destination = destination + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + if let method = HTTPMethod(rawValue: urlRequest.httpMethod ?? "GET"), encodesParametersInURL(with: method) { + guard let url = urlRequest.url else { + throw AFError.parameterEncodingFailed(reason: .missingURL) + } + + if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { + let percentEncodedQuery = (urlComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters) + urlComponents.percentEncodedQuery = percentEncodedQuery + urlRequest.url = urlComponents.url + } + } else { + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = query(parameters).data(using: .utf8, allowLossyConversion: false) + } + + return urlRequest + } + + /// Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion. + /// + /// - parameter key: The key of the query component. + /// - parameter value: The value of the query component. + /// + /// - returns: The percent-escaped, URL encoded query string components. + public func queryComponents(fromKey key: String, value: Any) -> [(String, String)] { + var components: [(String, String)] = [] + + if let dictionary = value as? [String: Any] { + for (nestedKey, value) in dictionary { + components += queryComponents(fromKey: "\(key)[\(nestedKey)]", value: value) + } + } else if let array = value as? [Any] { + for value in array { + components += queryComponents(fromKey: "\(key)[]", value: value) + } + } else if let value = value as? NSNumber { + if value.isBool { + components.append((escape(key), escape((value.boolValue ? "1" : "0")))) + } else { + components.append((escape(key), escape("\(value)"))) + } + } else if let bool = value as? Bool { + components.append((escape(key), escape((bool ? "1" : "0")))) + } else { + components.append((escape(key), escape("\(value)"))) + } + + return components + } + + /// Returns a percent-escaped string following RFC 3986 for a query string key or value. + /// + /// RFC 3986 states that the following characters are "reserved" characters. + /// + /// - General Delimiters: ":", "#", "[", "]", "@", "?", "/" + /// - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" + /// + /// In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow + /// query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" + /// should be percent-escaped in the query string. + /// + /// - parameter string: The string to be percent-escaped. + /// + /// - returns: The percent-escaped string. + public func escape(_ string: String) -> String { + let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 + let subDelimitersToEncode = "!$&'()*+,;=" + + var allowedCharacterSet = CharacterSet.urlQueryAllowed + allowedCharacterSet.remove(charactersIn: "\(generalDelimitersToEncode)\(subDelimitersToEncode)") + + var escaped = "" + + //========================================================================================================== + // + // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few + // hundred Chinese characters causes various malloc error crashes. To avoid this issue until iOS 8 is no + // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more + // info, please refer to: + // + // - https://github.com/Alamofire/Alamofire/issues/206 + // + //========================================================================================================== + + if #available(iOS 8.3, *) { + escaped = string.addingPercentEncoding(withAllowedCharacters: allowedCharacterSet) ?? string + } else { + let batchSize = 50 + var index = string.startIndex + + while index != string.endIndex { + let startIndex = index + let endIndex = string.index(index, offsetBy: batchSize, limitedBy: string.endIndex) ?? string.endIndex + let range = startIndex.. String { + var components: [(String, String)] = [] + + for key in parameters.keys.sorted(by: <) { + let value = parameters[key]! + components += queryComponents(fromKey: key, value: value) + } + return components.map { "\($0)=\($1)" }.joined(separator: "&") + } + + private func encodesParametersInURL(with method: HTTPMethod) -> Bool { + switch destination { + case .queryString: + return true + case .httpBody: + return false + default: + break + } + + switch method { + case .get, .head, .delete: + return true + default: + return false + } + } +} + +// MARK: - + +/// Uses `JSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the +/// request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. +public struct JSONEncoding: ParameterEncoding { + + // MARK: Properties + + /// Returns a `JSONEncoding` instance with default writing options. + public static var `default`: JSONEncoding { return JSONEncoding() } + + /// Returns a `JSONEncoding` instance with `.prettyPrinted` writing options. + public static var prettyPrinted: JSONEncoding { return JSONEncoding(options: .prettyPrinted) } + + /// The options for writing the parameters as JSON data. + public let options: JSONSerialization.WritingOptions + + // MARK: Initialization + + /// Creates a `JSONEncoding` instance using the specified options. + /// + /// - parameter options: The options for writing the parameters as JSON data. + /// + /// - returns: The new `JSONEncoding` instance. + public init(options: JSONSerialization.WritingOptions = []) { + self.options = options + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + do { + let data = try JSONSerialization.data(withJSONObject: parameters, options: options) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) + } + + return urlRequest + } + + /// Creates a URL request by encoding the JSON object and setting the resulting data on the HTTP body. + /// + /// - parameter urlRequest: The request to apply the JSON object to. + /// - parameter jsonObject: The JSON object to apply to the request. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, withJSONObject jsonObject: Any? = nil) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let jsonObject = jsonObject else { return urlRequest } + + do { + let data = try JSONSerialization.data(withJSONObject: jsonObject, options: options) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) + } + + return urlRequest + } +} + +// MARK: - + +/// Uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the +/// associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header +/// field of an encoded request is set to `application/x-plist`. +public struct PropertyListEncoding: ParameterEncoding { + + // MARK: Properties + + /// Returns a default `PropertyListEncoding` instance. + public static var `default`: PropertyListEncoding { return PropertyListEncoding() } + + /// Returns a `PropertyListEncoding` instance with xml formatting and default writing options. + public static var xml: PropertyListEncoding { return PropertyListEncoding(format: .xml) } + + /// Returns a `PropertyListEncoding` instance with binary formatting and default writing options. + public static var binary: PropertyListEncoding { return PropertyListEncoding(format: .binary) } + + /// The property list serialization format. + public let format: PropertyListSerialization.PropertyListFormat + + /// The options for writing the parameters as plist data. + public let options: PropertyListSerialization.WriteOptions + + // MARK: Initialization + + /// Creates a `PropertyListEncoding` instance using the specified format and options. + /// + /// - parameter format: The property list serialization format. + /// - parameter options: The options for writing the parameters as plist data. + /// + /// - returns: The new `PropertyListEncoding` instance. + public init( + format: PropertyListSerialization.PropertyListFormat = .xml, + options: PropertyListSerialization.WriteOptions = 0) + { + self.format = format + self.options = options + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + do { + let data = try PropertyListSerialization.data( + fromPropertyList: parameters, + format: format, + options: options + ) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .propertyListEncodingFailed(error: error)) + } + + return urlRequest + } +} + +// MARK: - + +extension NSNumber { + fileprivate var isBool: Bool { return CFBooleanGetTypeID() == CFGetTypeID(self) } +} diff --git a/client/Pods/Alamofire/Source/Request.swift b/client/Pods/Alamofire/Source/Request.swift new file mode 100644 index 00000000..d93c52d1 --- /dev/null +++ b/client/Pods/Alamofire/Source/Request.swift @@ -0,0 +1,653 @@ +// +// Request.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// A type that can inspect and optionally adapt a `URLRequest` in some manner if necessary. +public protocol RequestAdapter { + /// Inspects and adapts the specified `URLRequest` in some manner if necessary and returns the result. + /// + /// - parameter urlRequest: The URL request to adapt. + /// + /// - throws: An `Error` if the adaptation encounters an error. + /// + /// - returns: The adapted `URLRequest`. + func adapt(_ urlRequest: URLRequest) throws -> URLRequest +} + +// MARK: - + +/// A closure executed when the `RequestRetrier` determines whether a `Request` should be retried or not. +public typealias RequestRetryCompletion = (_ shouldRetry: Bool, _ timeDelay: TimeInterval) -> Void + +/// A type that determines whether a request should be retried after being executed by the specified session manager +/// and encountering an error. +public protocol RequestRetrier { + /// Determines whether the `Request` should be retried by calling the `completion` closure. + /// + /// This operation is fully asynchronous. Any amount of time can be taken to determine whether the request needs + /// to be retried. The one requirement is that the completion closure is called to ensure the request is properly + /// cleaned up after. + /// + /// - parameter manager: The session manager the request was executed on. + /// - parameter request: The request that failed due to the encountered error. + /// - parameter error: The error encountered when executing the request. + /// - parameter completion: The completion closure to be executed when retry decision has been determined. + func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) +} + +// MARK: - + +protocol TaskConvertible { + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask +} + +/// A dictionary of headers to apply to a `URLRequest`. +public typealias HTTPHeaders = [String: String] + +// MARK: - + +/// Responsible for sending a request and receiving the response and associated data from the server, as well as +/// managing its underlying `URLSessionTask`. +open class Request { + + // MARK: Helper Types + + /// A closure executed when monitoring upload or download progress of a request. + public typealias ProgressHandler = (Progress) -> Void + + enum RequestTask { + case data(TaskConvertible?, URLSessionTask?) + case download(TaskConvertible?, URLSessionTask?) + case upload(TaskConvertible?, URLSessionTask?) + case stream(TaskConvertible?, URLSessionTask?) + } + + // MARK: Properties + + /// The delegate for the underlying task. + open internal(set) var delegate: TaskDelegate { + get { + taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } + return taskDelegate + } + set { + taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } + taskDelegate = newValue + } + } + + /// The underlying task. + open var task: URLSessionTask? { return delegate.task } + + /// The session belonging to the underlying task. + open let session: URLSession + + /// The request sent or to be sent to the server. + open var request: URLRequest? { return task?.originalRequest } + + /// The response received from the server, if any. + open var response: HTTPURLResponse? { return task?.response as? HTTPURLResponse } + + /// The number of times the request has been retried. + open internal(set) var retryCount: UInt = 0 + + let originalTask: TaskConvertible? + + var startTime: CFAbsoluteTime? + var endTime: CFAbsoluteTime? + + var validations: [() -> Void] = [] + + private var taskDelegate: TaskDelegate + private var taskDelegateLock = NSLock() + + // MARK: Lifecycle + + init(session: URLSession, requestTask: RequestTask, error: Error? = nil) { + self.session = session + + switch requestTask { + case .data(let originalTask, let task): + taskDelegate = DataTaskDelegate(task: task) + self.originalTask = originalTask + case .download(let originalTask, let task): + taskDelegate = DownloadTaskDelegate(task: task) + self.originalTask = originalTask + case .upload(let originalTask, let task): + taskDelegate = UploadTaskDelegate(task: task) + self.originalTask = originalTask + case .stream(let originalTask, let task): + taskDelegate = TaskDelegate(task: task) + self.originalTask = originalTask + } + + delegate.error = error + delegate.queue.addOperation { self.endTime = CFAbsoluteTimeGetCurrent() } + } + + // MARK: Authentication + + /// Associates an HTTP Basic credential with the request. + /// + /// - parameter user: The user. + /// - parameter password: The password. + /// - parameter persistence: The URL credential persistence. `.ForSession` by default. + /// + /// - returns: The request. + @discardableResult + open func authenticate( + user: String, + password: String, + persistence: URLCredential.Persistence = .forSession) + -> Self + { + let credential = URLCredential(user: user, password: password, persistence: persistence) + return authenticate(usingCredential: credential) + } + + /// Associates a specified credential with the request. + /// + /// - parameter credential: The credential. + /// + /// - returns: The request. + @discardableResult + open func authenticate(usingCredential credential: URLCredential) -> Self { + delegate.credential = credential + return self + } + + /// Returns a base64 encoded basic authentication credential as an authorization header tuple. + /// + /// - parameter user: The user. + /// - parameter password: The password. + /// + /// - returns: A tuple with Authorization header and credential value if encoding succeeds, `nil` otherwise. + open static func authorizationHeader(user: String, password: String) -> (key: String, value: String)? { + guard let data = "\(user):\(password)".data(using: .utf8) else { return nil } + + let credential = data.base64EncodedString(options: []) + + return (key: "Authorization", value: "Basic \(credential)") + } + + // MARK: State + + /// Resumes the request. + open func resume() { + guard let task = task else { delegate.queue.isSuspended = false ; return } + + if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() } + + task.resume() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidResume, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } + + /// Suspends the request. + open func suspend() { + guard let task = task else { return } + + task.suspend() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidSuspend, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } + + /// Cancels the request. + open func cancel() { + guard let task = task else { return } + + task.cancel() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidCancel, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } +} + +// MARK: - CustomStringConvertible + +extension Request: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes the HTTP method and URL, as + /// well as the response status code if a response has been received. + open var description: String { + var components: [String] = [] + + if let HTTPMethod = request?.httpMethod { + components.append(HTTPMethod) + } + + if let urlString = request?.url?.absoluteString { + components.append(urlString) + } + + if let response = response { + components.append("(\(response.statusCode))") + } + + return components.joined(separator: " ") + } +} + +// MARK: - CustomDebugStringConvertible + +extension Request: CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, in the form of a cURL command. + open var debugDescription: String { + return cURLRepresentation() + } + + func cURLRepresentation() -> String { + var components = ["$ curl -v"] + + guard let request = self.request, + let url = request.url, + let host = url.host + else { + return "$ curl command could not be created" + } + + if let httpMethod = request.httpMethod, httpMethod != "GET" { + components.append("-X \(httpMethod)") + } + + if let credentialStorage = self.session.configuration.urlCredentialStorage { + let protectionSpace = URLProtectionSpace( + host: host, + port: url.port ?? 0, + protocol: url.scheme, + realm: host, + authenticationMethod: NSURLAuthenticationMethodHTTPBasic + ) + + if let credentials = credentialStorage.credentials(for: protectionSpace)?.values { + for credential in credentials { + guard let user = credential.user, let password = credential.password else { continue } + components.append("-u \(user):\(password)") + } + } else { + if let credential = delegate.credential, let user = credential.user, let password = credential.password { + components.append("-u \(user):\(password)") + } + } + } + + if session.configuration.httpShouldSetCookies { + if + let cookieStorage = session.configuration.httpCookieStorage, + let cookies = cookieStorage.cookies(for: url), !cookies.isEmpty + { + let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value);" } + + #if swift(>=3.2) + components.append("-b \"\(string[.. URLSessionTask { + do { + let urlRequest = try self.urlRequest.adapt(using: adapter) + return queue.sync { session.dataTask(with: urlRequest) } + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + if let requestable = originalTask as? Requestable { return requestable.urlRequest } + + return nil + } + + /// The progress of fetching the response data from the server for the request. + open var progress: Progress { return dataDelegate.progress } + + var dataDelegate: DataTaskDelegate { return delegate as! DataTaskDelegate } + + // MARK: Stream + + /// Sets a closure to be called periodically during the lifecycle of the request as data is read from the server. + /// + /// This closure returns the bytes most recently received from the server, not including data from previous calls. + /// If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is + /// also important to note that the server data in any `Response` object will be `nil`. + /// + /// - parameter closure: The code to be executed periodically during the lifecycle of the request. + /// + /// - returns: The request. + @discardableResult + open func stream(closure: ((Data) -> Void)? = nil) -> Self { + dataDelegate.dataStream = closure + return self + } + + // MARK: Progress + + /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is read from the server. + /// + /// - returns: The request. + @discardableResult + open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + dataDelegate.progressHandler = (closure, queue) + return self + } +} + +// MARK: - + +/// Specific type of `Request` that manages an underlying `URLSessionDownloadTask`. +open class DownloadRequest: Request { + + // MARK: Helper Types + + /// A collection of options to be executed prior to moving a downloaded file from the temporary URL to the + /// destination URL. + public struct DownloadOptions: OptionSet { + /// Returns the raw bitmask value of the option and satisfies the `RawRepresentable` protocol. + public let rawValue: UInt + + /// A `DownloadOptions` flag that creates intermediate directories for the destination URL if specified. + public static let createIntermediateDirectories = DownloadOptions(rawValue: 1 << 0) + + /// A `DownloadOptions` flag that removes a previous file from the destination URL if specified. + public static let removePreviousFile = DownloadOptions(rawValue: 1 << 1) + + /// Creates a `DownloadFileDestinationOptions` instance with the specified raw value. + /// + /// - parameter rawValue: The raw bitmask value for the option. + /// + /// - returns: A new log level instance. + public init(rawValue: UInt) { + self.rawValue = rawValue + } + } + + /// A closure executed once a download request has successfully completed in order to determine where to move the + /// temporary file written to during the download process. The closure takes two arguments: the temporary file URL + /// and the URL response, and returns a two arguments: the file URL where the temporary file should be moved and + /// the options defining how the file should be moved. + public typealias DownloadFileDestination = ( + _ temporaryURL: URL, + _ response: HTTPURLResponse) + -> (destinationURL: URL, options: DownloadOptions) + + enum Downloadable: TaskConvertible { + case request(URLRequest) + case resumeData(Data) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + do { + let task: URLSessionTask + + switch self { + case let .request(urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.downloadTask(with: urlRequest) } + case let .resumeData(resumeData): + task = queue.sync { session.downloadTask(withResumeData: resumeData) } + } + + return task + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + + if let downloadable = originalTask as? Downloadable, case let .request(urlRequest) = downloadable { + return urlRequest + } + + return nil + } + + /// The resume data of the underlying download task if available after a failure. + open var resumeData: Data? { return downloadDelegate.resumeData } + + /// The progress of downloading the response data from the server for the request. + open var progress: Progress { return downloadDelegate.progress } + + var downloadDelegate: DownloadTaskDelegate { return delegate as! DownloadTaskDelegate } + + // MARK: State + + /// Cancels the request. + open override func cancel() { + downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 } + + NotificationCenter.default.post( + name: Notification.Name.Task.DidCancel, + object: self, + userInfo: [Notification.Key.Task: task as Any] + ) + } + + // MARK: Progress + + /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is read from the server. + /// + /// - returns: The request. + @discardableResult + open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + downloadDelegate.progressHandler = (closure, queue) + return self + } + + // MARK: Destination + + /// Creates a download file destination closure which uses the default file manager to move the temporary file to a + /// file URL in the first available directory with the specified search path directory and search path domain mask. + /// + /// - parameter directory: The search path directory. `.DocumentDirectory` by default. + /// - parameter domain: The search path domain mask. `.UserDomainMask` by default. + /// + /// - returns: A download file destination closure. + open class func suggestedDownloadDestination( + for directory: FileManager.SearchPathDirectory = .documentDirectory, + in domain: FileManager.SearchPathDomainMask = .userDomainMask) + -> DownloadFileDestination + { + return { temporaryURL, response in + let directoryURLs = FileManager.default.urls(for: directory, in: domain) + + if !directoryURLs.isEmpty { + return (directoryURLs[0].appendingPathComponent(response.suggestedFilename!), []) + } + + return (temporaryURL, []) + } + } +} + +// MARK: - + +/// Specific type of `Request` that manages an underlying `URLSessionUploadTask`. +open class UploadRequest: DataRequest { + + // MARK: Helper Types + + enum Uploadable: TaskConvertible { + case data(Data, URLRequest) + case file(URL, URLRequest) + case stream(InputStream, URLRequest) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + do { + let task: URLSessionTask + + switch self { + case let .data(data, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(with: urlRequest, from: data) } + case let .file(url, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(with: urlRequest, fromFile: url) } + case let .stream(_, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(withStreamedRequest: urlRequest) } + } + + return task + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + + guard let uploadable = originalTask as? Uploadable else { return nil } + + switch uploadable { + case .data(_, let urlRequest), .file(_, let urlRequest), .stream(_, let urlRequest): + return urlRequest + } + } + + /// The progress of uploading the payload to the server for the upload request. + open var uploadProgress: Progress { return uploadDelegate.uploadProgress } + + var uploadDelegate: UploadTaskDelegate { return delegate as! UploadTaskDelegate } + + // MARK: Upload Progress + + /// Sets a closure to be called periodically during the lifecycle of the `UploadRequest` as data is sent to + /// the server. + /// + /// After the data is sent to the server, the `progress(queue:closure:)` APIs can be used to monitor the progress + /// of data being read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is sent to the server. + /// + /// - returns: The request. + @discardableResult + open func uploadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + uploadDelegate.uploadProgressHandler = (closure, queue) + return self + } +} + +// MARK: - + +#if !os(watchOS) + +/// Specific type of `Request` that manages an underlying `URLSessionStreamTask`. +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +open class StreamRequest: Request { + enum Streamable: TaskConvertible { + case stream(hostName: String, port: Int) + case netService(NetService) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + let task: URLSessionTask + + switch self { + case let .stream(hostName, port): + task = queue.sync { session.streamTask(withHostName: hostName, port: port) } + case let .netService(netService): + task = queue.sync { session.streamTask(with: netService) } + } + + return task + } + } +} + +#endif diff --git a/client/Pods/Alamofire/Source/Response.swift b/client/Pods/Alamofire/Source/Response.swift new file mode 100644 index 00000000..703eeb4d --- /dev/null +++ b/client/Pods/Alamofire/Source/Response.swift @@ -0,0 +1,465 @@ +// +// Response.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Used to store all data associated with an non-serialized response of a data or upload request. +public struct DefaultDataResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The data returned by the server. + public let data: Data? + + /// The error encountered while executing or validating the request. + public let error: Error? + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + var _metrics: AnyObject? + + /// Creates a `DefaultDataResponse` instance from the specified parameters. + /// + /// - Parameters: + /// - request: The URL request sent to the server. + /// - response: The server's response to the URL request. + /// - data: The data returned by the server. + /// - error: The error encountered while executing or validating the request. + /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. + /// - metrics: The task metrics containing the request / response statistics. `nil` by default. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + data: Data?, + error: Error?, + timeline: Timeline = Timeline(), + metrics: AnyObject? = nil) + { + self.request = request + self.response = response + self.data = data + self.error = error + self.timeline = timeline + } +} + +// MARK: - + +/// Used to store all data associated with a serialized response of a data or upload request. +public struct DataResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The data returned by the server. + public let data: Data? + + /// The result of response serialization. + public let result: Result + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + /// Returns the associated value of the result if it is a success, `nil` otherwise. + public var value: Value? { return result.value } + + /// Returns the associated error value if the result if it is a failure, `nil` otherwise. + public var error: Error? { return result.error } + + var _metrics: AnyObject? + + /// Creates a `DataResponse` instance with the specified parameters derived from response serialization. + /// + /// - parameter request: The URL request sent to the server. + /// - parameter response: The server's response to the URL request. + /// - parameter data: The data returned by the server. + /// - parameter result: The result of response serialization. + /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. + /// + /// - returns: The new `DataResponse` instance. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + data: Data?, + result: Result, + timeline: Timeline = Timeline()) + { + self.request = request + self.response = response + self.data = data + self.result = result + self.timeline = timeline + } +} + +// MARK: - + +extension DataResponse: CustomStringConvertible, CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + return result.debugDescription + } + + /// The debug textual representation used when written to an output stream, which includes the URL request, the URL + /// response, the server data, the response serialization result and the timeline. + public var debugDescription: String { + var output: [String] = [] + + output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") + output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") + output.append("[Data]: \(data?.count ?? 0) bytes") + output.append("[Result]: \(result.debugDescription)") + output.append("[Timeline]: \(timeline.debugDescription)") + + return output.joined(separator: "\n") + } +} + +// MARK: - + +extension DataResponse { + /// Evaluates the specified closure when the result of this `DataResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: DataResponse = ... + /// let possibleInt = possibleData.map { $0.count } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A `DataResponse` whose result wraps the value returned by the given closure. If this instance's + /// result is a failure, returns a response wrapping the same failure. + public func map(_ transform: (Value) -> T) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.map(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the given closure when the result of this `DataResponse` is a success, passing the unwrapped result + /// value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: DataResponse = ... + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A success or failure `DataResponse` depending on the result of the given closure. If this instance's + /// result is a failure, returns the same failure. + public func flatMap(_ transform: (Value) throws -> T) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.flatMap(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } +} + +// MARK: - + +/// Used to store all data associated with an non-serialized response of a download request. +public struct DefaultDownloadResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The temporary destination URL of the data returned from the server. + public let temporaryURL: URL? + + /// The final destination URL of the data returned from the server if it was moved. + public let destinationURL: URL? + + /// The resume data generated if the request was cancelled. + public let resumeData: Data? + + /// The error encountered while executing or validating the request. + public let error: Error? + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + var _metrics: AnyObject? + + /// Creates a `DefaultDownloadResponse` instance from the specified parameters. + /// + /// - Parameters: + /// - request: The URL request sent to the server. + /// - response: The server's response to the URL request. + /// - temporaryURL: The temporary destination URL of the data returned from the server. + /// - destinationURL: The final destination URL of the data returned from the server if it was moved. + /// - resumeData: The resume data generated if the request was cancelled. + /// - error: The error encountered while executing or validating the request. + /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. + /// - metrics: The task metrics containing the request / response statistics. `nil` by default. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + temporaryURL: URL?, + destinationURL: URL?, + resumeData: Data?, + error: Error?, + timeline: Timeline = Timeline(), + metrics: AnyObject? = nil) + { + self.request = request + self.response = response + self.temporaryURL = temporaryURL + self.destinationURL = destinationURL + self.resumeData = resumeData + self.error = error + self.timeline = timeline + } +} + +// MARK: - + +/// Used to store all data associated with a serialized response of a download request. +public struct DownloadResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The temporary destination URL of the data returned from the server. + public let temporaryURL: URL? + + /// The final destination URL of the data returned from the server if it was moved. + public let destinationURL: URL? + + /// The resume data generated if the request was cancelled. + public let resumeData: Data? + + /// The result of response serialization. + public let result: Result + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + /// Returns the associated value of the result if it is a success, `nil` otherwise. + public var value: Value? { return result.value } + + /// Returns the associated error value if the result if it is a failure, `nil` otherwise. + public var error: Error? { return result.error } + + var _metrics: AnyObject? + + /// Creates a `DownloadResponse` instance with the specified parameters derived from response serialization. + /// + /// - parameter request: The URL request sent to the server. + /// - parameter response: The server's response to the URL request. + /// - parameter temporaryURL: The temporary destination URL of the data returned from the server. + /// - parameter destinationURL: The final destination URL of the data returned from the server if it was moved. + /// - parameter resumeData: The resume data generated if the request was cancelled. + /// - parameter result: The result of response serialization. + /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. + /// + /// - returns: The new `DownloadResponse` instance. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + temporaryURL: URL?, + destinationURL: URL?, + resumeData: Data?, + result: Result, + timeline: Timeline = Timeline()) + { + self.request = request + self.response = response + self.temporaryURL = temporaryURL + self.destinationURL = destinationURL + self.resumeData = resumeData + self.result = result + self.timeline = timeline + } +} + +// MARK: - + +extension DownloadResponse: CustomStringConvertible, CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + return result.debugDescription + } + + /// The debug textual representation used when written to an output stream, which includes the URL request, the URL + /// response, the temporary and destination URLs, the resume data, the response serialization result and the + /// timeline. + public var debugDescription: String { + var output: [String] = [] + + output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") + output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") + output.append("[TemporaryURL]: \(temporaryURL?.path ?? "nil")") + output.append("[DestinationURL]: \(destinationURL?.path ?? "nil")") + output.append("[ResumeData]: \(resumeData?.count ?? 0) bytes") + output.append("[Result]: \(result.debugDescription)") + output.append("[Timeline]: \(timeline.debugDescription)") + + return output.joined(separator: "\n") + } +} + +// MARK: - + +extension DownloadResponse { + /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let possibleInt = possibleData.map { $0.count } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A `DownloadResponse` whose result wraps the value returned by the given closure. If this instance's + /// result is a failure, returns a response wrapping the same failure. + public func map(_ transform: (Value) -> T) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.map(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A success or failure `DownloadResponse` depending on the result of the given closure. If this + /// instance's result is a failure, returns the same failure. + public func flatMap(_ transform: (Value) throws -> T) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.flatMap(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } +} + +// MARK: - + +protocol Response { + /// The task metrics containing the request / response statistics. + var _metrics: AnyObject? { get set } + mutating func add(_ metrics: AnyObject?) +} + +extension Response { + mutating func add(_ metrics: AnyObject?) { + #if !os(watchOS) + guard #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) else { return } + guard let metrics = metrics as? URLSessionTaskMetrics else { return } + + _metrics = metrics + #endif + } +} + +// MARK: - + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DefaultDataResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DataResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DefaultDownloadResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DownloadResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} diff --git a/client/Pods/Alamofire/Source/ResponseSerialization.swift b/client/Pods/Alamofire/Source/ResponseSerialization.swift new file mode 100644 index 00000000..1f29ed85 --- /dev/null +++ b/client/Pods/Alamofire/Source/ResponseSerialization.swift @@ -0,0 +1,715 @@ +// +// ResponseSerialization.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// The type in which all data response serializers must conform to in order to serialize a response. +public protocol DataResponseSerializerProtocol { + /// The type of serialized object to be created by this `DataResponseSerializerType`. + associatedtype SerializedObject + + /// A closure used by response handlers that takes a request, response, data and error and returns a result. + var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result { get } +} + +// MARK: - + +/// A generic `DataResponseSerializerType` used to serialize a request, response, and data into a serialized object. +public struct DataResponseSerializer: DataResponseSerializerProtocol { + /// The type of serialized object to be created by this `DataResponseSerializer`. + public typealias SerializedObject = Value + + /// A closure used by response handlers that takes a request, response, data and error and returns a result. + public var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result + + /// Initializes the `ResponseSerializer` instance with the given serialize response closure. + /// + /// - parameter serializeResponse: The closure used to serialize the response. + /// + /// - returns: The new generic response serializer instance. + public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result) { + self.serializeResponse = serializeResponse + } +} + +// MARK: - + +/// The type in which all download response serializers must conform to in order to serialize a response. +public protocol DownloadResponseSerializerProtocol { + /// The type of serialized object to be created by this `DownloadResponseSerializerType`. + associatedtype SerializedObject + + /// A closure used by response handlers that takes a request, response, url and error and returns a result. + var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result { get } +} + +// MARK: - + +/// A generic `DownloadResponseSerializerType` used to serialize a request, response, and data into a serialized object. +public struct DownloadResponseSerializer: DownloadResponseSerializerProtocol { + /// The type of serialized object to be created by this `DownloadResponseSerializer`. + public typealias SerializedObject = Value + + /// A closure used by response handlers that takes a request, response, url and error and returns a result. + public var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result + + /// Initializes the `ResponseSerializer` instance with the given serialize response closure. + /// + /// - parameter serializeResponse: The closure used to serialize the response. + /// + /// - returns: The new generic response serializer instance. + public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result) { + self.serializeResponse = serializeResponse + } +} + +// MARK: - Timeline + +extension Request { + var timeline: Timeline { + let requestStartTime = self.startTime ?? CFAbsoluteTimeGetCurrent() + let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() + let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime + + return Timeline( + requestStartTime: requestStartTime, + initialResponseTime: initialResponseTime, + requestCompletedTime: requestCompletedTime, + serializationCompletedTime: CFAbsoluteTimeGetCurrent() + ) + } +} + +// MARK: - Default + +extension DataRequest { + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response(queue: DispatchQueue? = nil, completionHandler: @escaping (DefaultDataResponse) -> Void) -> Self { + delegate.queue.addOperation { + (queue ?? DispatchQueue.main).async { + var dataResponse = DefaultDataResponse( + request: self.request, + response: self.response, + data: self.delegate.data, + error: self.delegate.error, + timeline: self.timeline + ) + + dataResponse.add(self.delegate.metrics) + + completionHandler(dataResponse) + } + } + + return self + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, + /// and data. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + responseSerializer: T, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + let result = responseSerializer.serializeResponse( + self.request, + self.response, + self.delegate.data, + self.delegate.error + ) + + var dataResponse = DataResponse( + request: self.request, + response: self.response, + data: self.delegate.data, + result: result, + timeline: self.timeline + ) + + dataResponse.add(self.delegate.metrics) + + (queue ?? DispatchQueue.main).async { completionHandler(dataResponse) } + } + + return self + } +} + +extension DownloadRequest { + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DefaultDownloadResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + (queue ?? DispatchQueue.main).async { + var downloadResponse = DefaultDownloadResponse( + request: self.request, + response: self.response, + temporaryURL: self.downloadDelegate.temporaryURL, + destinationURL: self.downloadDelegate.destinationURL, + resumeData: self.downloadDelegate.resumeData, + error: self.downloadDelegate.error, + timeline: self.timeline + ) + + downloadResponse.add(self.delegate.metrics) + + completionHandler(downloadResponse) + } + } + + return self + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, + /// and data contained in the destination url. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + responseSerializer: T, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + let result = responseSerializer.serializeResponse( + self.request, + self.response, + self.downloadDelegate.fileURL, + self.downloadDelegate.error + ) + + var downloadResponse = DownloadResponse( + request: self.request, + response: self.response, + temporaryURL: self.downloadDelegate.temporaryURL, + destinationURL: self.downloadDelegate.destinationURL, + resumeData: self.downloadDelegate.resumeData, + result: result, + timeline: self.timeline + ) + + downloadResponse.add(self.delegate.metrics) + + (queue ?? DispatchQueue.main).async { completionHandler(downloadResponse) } + } + + return self + } +} + +// MARK: - Data + +extension Request { + /// Returns a result data type that contains the response data as-is. + /// + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseData(response: HTTPURLResponse?, data: Data?, error: Error?) -> Result { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(Data()) } + + guard let validData = data else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) + } + + return .success(validData) + } +} + +extension DataRequest { + /// Creates a response serializer that returns the associated data as-is. + /// + /// - returns: A data response serializer. + public static func dataResponseSerializer() -> DataResponseSerializer { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseData(response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseData( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.dataResponseSerializer(), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns the associated data as-is. + /// + /// - returns: A data response serializer. + public static func dataResponseSerializer() -> DownloadResponseSerializer { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseData(response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseData( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.dataResponseSerializer(), + completionHandler: completionHandler + ) + } +} + +// MARK: - String + +extension Request { + /// Returns a result string type initialized from the response data with the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseString( + encoding: String.Encoding?, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success("") } + + guard let validData = data else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) + } + + var convertedEncoding = encoding + + if let encodingName = response?.textEncodingName as CFString!, convertedEncoding == nil { + convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding( + CFStringConvertIANACharSetNameToEncoding(encodingName)) + ) + } + + let actualEncoding = convertedEncoding ?? String.Encoding.isoLatin1 + + if let string = String(data: validData, encoding: actualEncoding) { + return .success(string) + } else { + return .failure(AFError.responseSerializationFailed(reason: .stringSerializationFailed(encoding: actualEncoding))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns a result string type initialized from the response data with + /// the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// + /// - returns: A string response serializer. + public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DataResponseSerializer { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the + /// server response, falling back to the default HTTP default character set, + /// ISO-8859-1. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseString( + queue: DispatchQueue? = nil, + encoding: String.Encoding? = nil, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.stringResponseSerializer(encoding: encoding), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns a result string type initialized from the response data with + /// the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// + /// - returns: A string response serializer. + public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DownloadResponseSerializer { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the + /// server response, falling back to the default HTTP default character set, + /// ISO-8859-1. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseString( + queue: DispatchQueue? = nil, + encoding: String.Encoding? = nil, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.stringResponseSerializer(encoding: encoding), + completionHandler: completionHandler + ) + } +} + +// MARK: - JSON + +extension Request { + /// Returns a JSON object contained in a result type constructed from the response data using `JSONSerialization` + /// with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseJSON( + options: JSONSerialization.ReadingOptions, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } + + guard let validData = data, validData.count > 0 else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) + } + + do { + let json = try JSONSerialization.jsonObject(with: validData, options: options) + return .success(json) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns a JSON object result type constructed from the response data using + /// `JSONSerialization` with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// + /// - returns: A JSON object response serializer. + public static func jsonResponseSerializer( + options: JSONSerialization.ReadingOptions = .allowFragments) + -> DataResponseSerializer + { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseJSON( + queue: DispatchQueue? = nil, + options: JSONSerialization.ReadingOptions = .allowFragments, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.jsonResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns a JSON object result type constructed from the response data using + /// `JSONSerialization` with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// + /// - returns: A JSON object response serializer. + public static func jsonResponseSerializer( + options: JSONSerialization.ReadingOptions = .allowFragments) + -> DownloadResponseSerializer + { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseJSON( + queue: DispatchQueue? = nil, + options: JSONSerialization.ReadingOptions = .allowFragments, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.jsonResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +// MARK: - Property List + +extension Request { + /// Returns a plist object contained in a result type constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponsePropertyList( + options: PropertyListSerialization.ReadOptions, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } + + guard let validData = data, validData.count > 0 else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) + } + + do { + let plist = try PropertyListSerialization.propertyList(from: validData, options: options, format: nil) + return .success(plist) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .propertyListSerializationFailed(error: error))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns an object constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// + /// - returns: A property list object response serializer. + public static func propertyListResponseSerializer( + options: PropertyListSerialization.ReadOptions = []) + -> DataResponseSerializer + { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responsePropertyList( + queue: DispatchQueue? = nil, + options: PropertyListSerialization.ReadOptions = [], + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.propertyListResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns an object constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// + /// - returns: A property list object response serializer. + public static func propertyListResponseSerializer( + options: PropertyListSerialization.ReadOptions = []) + -> DownloadResponseSerializer + { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responsePropertyList( + queue: DispatchQueue? = nil, + options: PropertyListSerialization.ReadOptions = [], + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.propertyListResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +/// A set of HTTP response status code that do not contain response data. +private let emptyDataStatusCodes: Set = [204, 205] diff --git a/client/Pods/Alamofire/Source/Result.swift b/client/Pods/Alamofire/Source/Result.swift new file mode 100644 index 00000000..bbd3c618 --- /dev/null +++ b/client/Pods/Alamofire/Source/Result.swift @@ -0,0 +1,300 @@ +// +// Result.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Used to represent whether a request was successful or encountered an error. +/// +/// - success: The request and all post processing operations were successful resulting in the serialization of the +/// provided associated value. +/// +/// - failure: The request encountered an error resulting in a failure. The associated values are the original data +/// provided by the server as well as the error that caused the failure. +public enum Result { + case success(Value) + case failure(Error) + + /// Returns `true` if the result is a success, `false` otherwise. + public var isSuccess: Bool { + switch self { + case .success: + return true + case .failure: + return false + } + } + + /// Returns `true` if the result is a failure, `false` otherwise. + public var isFailure: Bool { + return !isSuccess + } + + /// Returns the associated value if the result is a success, `nil` otherwise. + public var value: Value? { + switch self { + case .success(let value): + return value + case .failure: + return nil + } + } + + /// Returns the associated error value if the result is a failure, `nil` otherwise. + public var error: Error? { + switch self { + case .success: + return nil + case .failure(let error): + return error + } + } +} + +// MARK: - CustomStringConvertible + +extension Result: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + switch self { + case .success: + return "SUCCESS" + case .failure: + return "FAILURE" + } + } +} + +// MARK: - CustomDebugStringConvertible + +extension Result: CustomDebugStringConvertible { + /// The debug textual representation used when written to an output stream, which includes whether the result was a + /// success or failure in addition to the value or error. + public var debugDescription: String { + switch self { + case .success(let value): + return "SUCCESS: \(value)" + case .failure(let error): + return "FAILURE: \(error)" + } + } +} + +// MARK: - Functional APIs + +extension Result { + /// Creates a `Result` instance from the result of a closure. + /// + /// A failure result is created when the closure throws, and a success result is created when the closure + /// succeeds without throwing an error. + /// + /// func someString() throws -> String { ... } + /// + /// let result = Result(value: { + /// return try someString() + /// }) + /// + /// // The type of result is Result + /// + /// The trailing closure syntax is also supported: + /// + /// let result = Result { try someString() } + /// + /// - parameter value: The closure to execute and create the result for. + public init(value: () throws -> Value) { + do { + self = try .success(value()) + } catch { + self = .failure(error) + } + } + + /// Returns the success value, or throws the failure error. + /// + /// let possibleString: Result = .success("success") + /// try print(possibleString.unwrap()) + /// // Prints "success" + /// + /// let noString: Result = .failure(error) + /// try print(noString.unwrap()) + /// // Throws error + public func unwrap() throws -> Value { + switch self { + case .success(let value): + return value + case .failure(let error): + throw error + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: Result = .success(Data()) + /// let possibleInt = possibleData.map { $0.count } + /// try print(possibleInt.unwrap()) + /// // Prints "0" + /// + /// let noData: Result = .failure(error) + /// let noInt = noData.map { $0.count } + /// try print(noInt.unwrap()) + /// // Throws error + /// + /// - parameter transform: A closure that takes the success value of the `Result` instance. + /// + /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the + /// same failure. + public func map(_ transform: (Value) -> T) -> Result { + switch self { + case .success(let value): + return .success(transform(value)) + case .failure(let error): + return .failure(error) + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance. + /// + /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the + /// same failure. + public func flatMap(_ transform: (Value) throws -> T) -> Result { + switch self { + case .success(let value): + do { + return try .success(transform(value)) + } catch { + return .failure(error) + } + case .failure(let error): + return .failure(error) + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: Result = .failure(someError) + /// let withMyError: Result = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func mapError(_ transform: (Error) -> T) -> Result { + switch self { + case .failure(let error): + return .failure(transform(error)) + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func flatMapError(_ transform: (Error) throws -> T) -> Result { + switch self { + case .failure(let error): + do { + return try .failure(transform(error)) + } catch { + return .failure(error) + } + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `withValue` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withValue(_ closure: (Value) -> Void) -> Result { + if case let .success(value) = self { closure(value) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `withError` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withError(_ closure: (Error) -> Void) -> Result { + if case let .failure(error) = self { closure(error) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a success. + /// + /// Use the `ifSuccess` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifSuccess(_ closure: () -> Void) -> Result { + if isSuccess { closure() } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure. + /// + /// Use the `ifFailure` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifFailure(_ closure: () -> Void) -> Result { + if isFailure { closure() } + + return self + } +} diff --git a/client/Pods/Alamofire/Source/ServerTrustPolicy.swift b/client/Pods/Alamofire/Source/ServerTrustPolicy.swift new file mode 100644 index 00000000..1ad3530b --- /dev/null +++ b/client/Pods/Alamofire/Source/ServerTrustPolicy.swift @@ -0,0 +1,307 @@ +// +// ServerTrustPolicy.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host. +open class ServerTrustPolicyManager { + /// The dictionary of policies mapped to a particular host. + open let policies: [String: ServerTrustPolicy] + + /// Initializes the `ServerTrustPolicyManager` instance with the given policies. + /// + /// Since different servers and web services can have different leaf certificates, intermediate and even root + /// certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This + /// allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key + /// pinning for host3 and disabling evaluation for host4. + /// + /// - parameter policies: A dictionary of all policies mapped to a particular host. + /// + /// - returns: The new `ServerTrustPolicyManager` instance. + public init(policies: [String: ServerTrustPolicy]) { + self.policies = policies + } + + /// Returns the `ServerTrustPolicy` for the given host if applicable. + /// + /// By default, this method will return the policy that perfectly matches the given host. Subclasses could override + /// this method and implement more complex mapping implementations such as wildcards. + /// + /// - parameter host: The host to use when searching for a matching policy. + /// + /// - returns: The server trust policy for the given host if found. + open func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? { + return policies[host] + } +} + +// MARK: - + +extension URLSession { + private struct AssociatedKeys { + static var managerKey = "URLSession.ServerTrustPolicyManager" + } + + var serverTrustPolicyManager: ServerTrustPolicyManager? { + get { + return objc_getAssociatedObject(self, &AssociatedKeys.managerKey) as? ServerTrustPolicyManager + } + set (manager) { + objc_setAssociatedObject(self, &AssociatedKeys.managerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) + } + } +} + +// MARK: - ServerTrustPolicy + +/// The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when +/// connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust +/// with a given set of criteria to determine whether the server trust is valid and the connection should be made. +/// +/// Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) 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 pinning enabled. +/// +/// - performDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to +/// validate the host provided by the challenge. Applications are encouraged to always +/// validate the host in production environments to guarantee the validity of the server's +/// certificate chain. +/// +/// - performRevokedEvaluation: Uses the default and revoked server trust evaluations allowing you to control whether to +/// validate the host provided by the challenge as well as specify the revocation flags for +/// testing for revoked certificates. Apple platforms did not start testing for revoked +/// certificates automatically until iOS 10.1, macOS 10.12 and tvOS 10.1 which is +/// demonstrated in our TLS tests. Applications are encouraged to always validate the host +/// in production environments to guarantee the validity of the server's certificate chain. +/// +/// - pinCertificates: Uses the pinned certificates to validate the server trust. The server trust is +/// considered valid if one of the pinned certificates match one of the server certificates. +/// By validating both the certificate chain and host, certificate pinning provides a very +/// secure form of server trust validation mitigating most, if not all, MITM attacks. +/// Applications are encouraged to always validate the host and require a valid certificate +/// chain in production environments. +/// +/// - pinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered +/// valid if one of the pinned public keys match one of the server certificate public keys. +/// By validating both the certificate chain and host, public key pinning provides a very +/// secure form of server trust validation mitigating most, if not all, MITM attacks. +/// Applications are encouraged to always validate the host and require a valid certificate +/// chain in production environments. +/// +/// - disableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid. +/// +/// - customEvaluation: Uses the associated closure to evaluate the validity of the server trust. +public enum ServerTrustPolicy { + case performDefaultEvaluation(validateHost: Bool) + case performRevokedEvaluation(validateHost: Bool, revocationFlags: CFOptionFlags) + case pinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool) + case pinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool) + case disableEvaluation + case customEvaluation((_ serverTrust: SecTrust, _ host: String) -> Bool) + + // MARK: - Bundle Location + + /// Returns all certificates within the given bundle with a `.cer` file extension. + /// + /// - parameter bundle: The bundle to search for all `.cer` files. + /// + /// - returns: All certificates within the given bundle. + public static func certificates(in bundle: Bundle = Bundle.main) -> [SecCertificate] { + var certificates: [SecCertificate] = [] + + let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in + bundle.paths(forResourcesOfType: fileExtension, inDirectory: nil) + }.joined()) + + for path in paths { + if + let certificateData = try? Data(contentsOf: URL(fileURLWithPath: path)) as CFData, + let certificate = SecCertificateCreateWithData(nil, certificateData) + { + certificates.append(certificate) + } + } + + return certificates + } + + /// Returns all public keys within the given bundle with a `.cer` file extension. + /// + /// - parameter bundle: The bundle to search for all `*.cer` files. + /// + /// - returns: All public keys within the given bundle. + public static func publicKeys(in bundle: Bundle = Bundle.main) -> [SecKey] { + var publicKeys: [SecKey] = [] + + for certificate in certificates(in: bundle) { + if let publicKey = publicKey(for: certificate) { + publicKeys.append(publicKey) + } + } + + return publicKeys + } + + // MARK: - Evaluation + + /// Evaluates whether the server trust is valid for the given host. + /// + /// - parameter serverTrust: The server trust to evaluate. + /// - parameter host: The host of the challenge protection space. + /// + /// - returns: Whether the server trust is valid. + public func evaluate(_ serverTrust: SecTrust, forHost host: String) -> Bool { + var serverTrustIsValid = false + + switch self { + case let .performDefaultEvaluation(validateHost): + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + serverTrustIsValid = trustIsValid(serverTrust) + case let .performRevokedEvaluation(validateHost, revocationFlags): + let defaultPolicy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + let revokedPolicy = SecPolicyCreateRevocation(revocationFlags) + SecTrustSetPolicies(serverTrust, [defaultPolicy, revokedPolicy] as CFTypeRef) + + serverTrustIsValid = trustIsValid(serverTrust) + case let .pinCertificates(pinnedCertificates, validateCertificateChain, validateHost): + if validateCertificateChain { + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates as CFArray) + SecTrustSetAnchorCertificatesOnly(serverTrust, true) + + serverTrustIsValid = trustIsValid(serverTrust) + } else { + let serverCertificatesDataArray = certificateData(for: serverTrust) + let pinnedCertificatesDataArray = certificateData(for: pinnedCertificates) + + outerLoop: for serverCertificateData in serverCertificatesDataArray { + for pinnedCertificateData in pinnedCertificatesDataArray { + if serverCertificateData == pinnedCertificateData { + serverTrustIsValid = true + break outerLoop + } + } + } + } + case let .pinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost): + var certificateChainEvaluationPassed = true + + if validateCertificateChain { + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + certificateChainEvaluationPassed = trustIsValid(serverTrust) + } + + if certificateChainEvaluationPassed { + outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeys(for: serverTrust) as [AnyObject] { + for pinnedPublicKey in pinnedPublicKeys as [AnyObject] { + if serverPublicKey.isEqual(pinnedPublicKey) { + serverTrustIsValid = true + break outerLoop + } + } + } + } + case .disableEvaluation: + serverTrustIsValid = true + case let .customEvaluation(closure): + serverTrustIsValid = closure(serverTrust, host) + } + + return serverTrustIsValid + } + + // MARK: - Private - Trust Validation + + private func trustIsValid(_ trust: SecTrust) -> Bool { + var isValid = false + + var result = SecTrustResultType.invalid + let status = SecTrustEvaluate(trust, &result) + + if status == errSecSuccess { + let unspecified = SecTrustResultType.unspecified + let proceed = SecTrustResultType.proceed + + + isValid = result == unspecified || result == proceed + } + + return isValid + } + + // MARK: - Private - Certificate Data + + private func certificateData(for trust: SecTrust) -> [Data] { + var certificates: [SecCertificate] = [] + + for index in 0.. [Data] { + return certificates.map { SecCertificateCopyData($0) as Data } + } + + // MARK: - Private - Public Key Extraction + + private static func publicKeys(for trust: SecTrust) -> [SecKey] { + var publicKeys: [SecKey] = [] + + for index in 0.. SecKey? { + var publicKey: SecKey? + + let policy = SecPolicyCreateBasicX509() + var trust: SecTrust? + let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust) + + if let trust = trust, trustCreationStatus == errSecSuccess { + publicKey = SecTrustCopyPublicKey(trust) + } + + return publicKey + } +} diff --git a/client/Pods/Alamofire/Source/SessionDelegate.swift b/client/Pods/Alamofire/Source/SessionDelegate.swift new file mode 100644 index 00000000..d38c253b --- /dev/null +++ b/client/Pods/Alamofire/Source/SessionDelegate.swift @@ -0,0 +1,719 @@ +// +// SessionDelegate.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for handling all delegate callbacks for the underlying session. +open class SessionDelegate: NSObject { + + // MARK: URLSessionDelegate Overrides + + /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didBecomeInvalidWithError:)`. + open var sessionDidBecomeInvalidWithError: ((URLSession, Error?) -> Void)? + + /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`. + open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + /// Overrides all behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)` and requires the caller to call the `completionHandler`. + open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. + open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? + + // MARK: URLSessionTaskDelegate Overrides + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`. + open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)` and + /// requires the caller to call the `completionHandler`. + open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)`. + open var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)` and + /// requires the caller to call the `completionHandler`. + open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)`. + open var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)` and + /// requires the caller to call the `completionHandler`. + open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, @escaping (InputStream?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)`. + open var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didCompleteWithError:)`. + open var taskDidComplete: ((URLSession, URLSessionTask, Error?) -> Void)? + + // MARK: URLSessionDataDelegate Overrides + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)`. + open var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? + + /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)` and + /// requires caller to call the `completionHandler`. + open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, @escaping (URLSession.ResponseDisposition) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didBecome:)`. + open var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:)`. + open var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`. + open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? + + /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)` and + /// requires caller to call the `completionHandler`. + open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, @escaping (CachedURLResponse?) -> Void) -> Void)? + + // MARK: URLSessionDownloadDelegate Overrides + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didFinishDownloadingTo:)`. + open var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> Void)? + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)`. + open var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)`. + open var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? + + // MARK: URLSessionStreamDelegate Overrides + +#if !os(watchOS) + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:readClosedFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskReadClosed: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskReadClosed as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskReadClosed = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:writeClosedFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskWriteClosed: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskWriteClosed as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskWriteClosed = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:betterRouteDiscoveredFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskBetterRouteDiscovered: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskBetterRouteDiscovered as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskBetterRouteDiscovered = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:streamTask:didBecome:outputStream:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskDidBecomeInputAndOutputStreams: ((URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void)? { + get { + return _streamTaskDidBecomeInputStream as? (URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void + } + set { + _streamTaskDidBecomeInputStream = newValue + } + } + + var _streamTaskReadClosed: Any? + var _streamTaskWriteClosed: Any? + var _streamTaskBetterRouteDiscovered: Any? + var _streamTaskDidBecomeInputStream: Any? + +#endif + + // MARK: Properties + + var retrier: RequestRetrier? + weak var sessionManager: SessionManager? + + private var requests: [Int: Request] = [:] + private let lock = NSLock() + + /// Access the task delegate for the specified task in a thread-safe manner. + open subscript(task: URLSessionTask) -> Request? { + get { + lock.lock() ; defer { lock.unlock() } + return requests[task.taskIdentifier] + } + set { + lock.lock() ; defer { lock.unlock() } + requests[task.taskIdentifier] = newValue + } + } + + // MARK: Lifecycle + + /// Initializes the `SessionDelegate` instance. + /// + /// - returns: The new `SessionDelegate` instance. + public override init() { + super.init() + } + + // MARK: NSObject Overrides + + /// Returns a `Bool` indicating whether the `SessionDelegate` implements or inherits a method that can respond + /// to a specified message. + /// + /// - parameter selector: A selector that identifies a message. + /// + /// - returns: `true` if the receiver implements or inherits a method that can respond to selector, otherwise `false`. + open override func responds(to selector: Selector) -> Bool { + #if !os(macOS) + if selector == #selector(URLSessionDelegate.urlSessionDidFinishEvents(forBackgroundURLSession:)) { + return sessionDidFinishEventsForBackgroundURLSession != nil + } + #endif + + #if !os(watchOS) + if #available(iOS 9.0, macOS 10.11, tvOS 9.0, *) { + switch selector { + case #selector(URLSessionStreamDelegate.urlSession(_:readClosedFor:)): + return streamTaskReadClosed != nil + case #selector(URLSessionStreamDelegate.urlSession(_:writeClosedFor:)): + return streamTaskWriteClosed != nil + case #selector(URLSessionStreamDelegate.urlSession(_:betterRouteDiscoveredFor:)): + return streamTaskBetterRouteDiscovered != nil + case #selector(URLSessionStreamDelegate.urlSession(_:streamTask:didBecome:outputStream:)): + return streamTaskDidBecomeInputAndOutputStreams != nil + default: + break + } + } + #endif + + switch selector { + case #selector(URLSessionDelegate.urlSession(_:didBecomeInvalidWithError:)): + return sessionDidBecomeInvalidWithError != nil + case #selector(URLSessionDelegate.urlSession(_:didReceive:completionHandler:)): + return (sessionDidReceiveChallenge != nil || sessionDidReceiveChallengeWithCompletion != nil) + case #selector(URLSessionTaskDelegate.urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)): + return (taskWillPerformHTTPRedirection != nil || taskWillPerformHTTPRedirectionWithCompletion != nil) + case #selector(URLSessionDataDelegate.urlSession(_:dataTask:didReceive:completionHandler:)): + return (dataTaskDidReceiveResponse != nil || dataTaskDidReceiveResponseWithCompletion != nil) + default: + return type(of: self).instancesRespond(to: selector) + } + } +} + +// MARK: - URLSessionDelegate + +extension SessionDelegate: URLSessionDelegate { + /// Tells the delegate that the session has been invalidated. + /// + /// - parameter session: The session object that was invalidated. + /// - parameter error: The error that caused invalidation, or nil if the invalidation was explicit. + open func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) { + sessionDidBecomeInvalidWithError?(session, error) + } + + /// Requests credentials from the delegate in response to a session-level authentication request from the + /// remote server. + /// + /// - parameter session: The session containing the task that requested authentication. + /// - parameter challenge: An object that contains the request for authentication. + /// - parameter completionHandler: A handler that your delegate method must call providing the disposition + /// and credential. + open func urlSession( + _ session: URLSession, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + guard sessionDidReceiveChallengeWithCompletion == nil else { + sessionDidReceiveChallengeWithCompletion?(session, challenge, completionHandler) + return + } + + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + var credential: URLCredential? + + if let sessionDidReceiveChallenge = sessionDidReceiveChallenge { + (disposition, credential) = sessionDidReceiveChallenge(session, challenge) + } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { + let host = challenge.protectionSpace.host + + if + let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), + let serverTrust = challenge.protectionSpace.serverTrust + { + if serverTrustPolicy.evaluate(serverTrust, forHost: host) { + disposition = .useCredential + credential = URLCredential(trust: serverTrust) + } else { + disposition = .cancelAuthenticationChallenge + } + } + } + + completionHandler(disposition, credential) + } + +#if !os(macOS) + + /// Tells the delegate that all messages enqueued for a session have been delivered. + /// + /// - parameter session: The session that no longer has any outstanding requests. + open func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) { + sessionDidFinishEventsForBackgroundURLSession?(session) + } + +#endif +} + +// MARK: - URLSessionTaskDelegate + +extension SessionDelegate: URLSessionTaskDelegate { + /// Tells the delegate that the remote server requested an HTTP redirect. + /// + /// - parameter session: The session containing the task whose request resulted in a redirect. + /// - parameter task: The task whose request resulted in a redirect. + /// - parameter response: An object containing the server’s response to the original request. + /// - parameter request: A URL request object filled out with the new location. + /// - parameter completionHandler: A closure that your handler should call with either the value of the request + /// parameter, a modified URL request object, or NULL to refuse the redirect and + /// return the body of the redirect response. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + willPerformHTTPRedirection response: HTTPURLResponse, + newRequest request: URLRequest, + completionHandler: @escaping (URLRequest?) -> Void) + { + guard taskWillPerformHTTPRedirectionWithCompletion == nil else { + taskWillPerformHTTPRedirectionWithCompletion?(session, task, response, request, completionHandler) + return + } + + var redirectRequest: URLRequest? = request + + if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { + redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) + } + + completionHandler(redirectRequest) + } + + /// Requests credentials from the delegate in response to an authentication request from the remote server. + /// + /// - parameter session: The session containing the task whose request requires authentication. + /// - parameter task: The task whose request requires authentication. + /// - parameter challenge: An object that contains the request for authentication. + /// - parameter completionHandler: A handler that your delegate method must call providing the disposition + /// and credential. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + guard taskDidReceiveChallengeWithCompletion == nil else { + taskDidReceiveChallengeWithCompletion?(session, task, challenge, completionHandler) + return + } + + if let taskDidReceiveChallenge = taskDidReceiveChallenge { + let result = taskDidReceiveChallenge(session, task, challenge) + completionHandler(result.0, result.1) + } else if let delegate = self[task]?.delegate { + delegate.urlSession( + session, + task: task, + didReceive: challenge, + completionHandler: completionHandler + ) + } else { + urlSession(session, didReceive: challenge, completionHandler: completionHandler) + } + } + + /// Tells the delegate when a task requires a new request body stream to send to the remote server. + /// + /// - parameter session: The session containing the task that needs a new body stream. + /// - parameter task: The task that needs a new body stream. + /// - parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) + { + guard taskNeedNewBodyStreamWithCompletion == nil else { + taskNeedNewBodyStreamWithCompletion?(session, task, completionHandler) + return + } + + if let taskNeedNewBodyStream = taskNeedNewBodyStream { + completionHandler(taskNeedNewBodyStream(session, task)) + } else if let delegate = self[task]?.delegate { + delegate.urlSession(session, task: task, needNewBodyStream: completionHandler) + } + } + + /// Periodically informs the delegate of the progress of sending body content to the server. + /// + /// - parameter session: The session containing the data task. + /// - parameter task: The data task. + /// - parameter bytesSent: The number of bytes sent since the last time this delegate method was called. + /// - parameter totalBytesSent: The total number of bytes sent so far. + /// - parameter totalBytesExpectedToSend: The expected length of the body data. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + didSendBodyData bytesSent: Int64, + totalBytesSent: Int64, + totalBytesExpectedToSend: Int64) + { + if let taskDidSendBodyData = taskDidSendBodyData { + taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) + } else if let delegate = self[task]?.delegate as? UploadTaskDelegate { + delegate.URLSession( + session, + task: task, + didSendBodyData: bytesSent, + totalBytesSent: totalBytesSent, + totalBytesExpectedToSend: totalBytesExpectedToSend + ) + } + } + +#if !os(watchOS) + + /// Tells the delegate that the session finished collecting metrics for the task. + /// + /// - parameter session: The session collecting the metrics. + /// - parameter task: The task whose metrics have been collected. + /// - parameter metrics: The collected metrics. + @available(iOS 10.0, macOS 10.12, tvOS 10.0, *) + @objc(URLSession:task:didFinishCollectingMetrics:) + open func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) { + self[task]?.delegate.metrics = metrics + } + +#endif + + /// Tells the delegate that the task finished transferring data. + /// + /// - parameter session: The session containing the task whose request finished transferring data. + /// - parameter task: The task whose request finished transferring data. + /// - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil. + open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + /// Executed after it is determined that the request is not going to be retried + let completeTask: (URLSession, URLSessionTask, Error?) -> Void = { [weak self] session, task, error in + guard let strongSelf = self else { return } + + strongSelf.taskDidComplete?(session, task, error) + + strongSelf[task]?.delegate.urlSession(session, task: task, didCompleteWithError: error) + + NotificationCenter.default.post( + name: Notification.Name.Task.DidComplete, + object: strongSelf, + userInfo: [Notification.Key.Task: task] + ) + + strongSelf[task] = nil + } + + guard let request = self[task], let sessionManager = sessionManager else { + completeTask(session, task, error) + return + } + + // Run all validations on the request before checking if an error occurred + request.validations.forEach { $0() } + + // Determine whether an error has occurred + var error: Error? = error + + if request.delegate.error != nil { + error = request.delegate.error + } + + /// If an error occurred and the retrier is set, asynchronously ask the retrier if the request + /// should be retried. Otherwise, complete the task by notifying the task delegate. + if let retrier = retrier, let error = error { + retrier.should(sessionManager, retry: request, with: error) { [weak self] shouldRetry, timeDelay in + guard shouldRetry else { completeTask(session, task, error) ; return } + + DispatchQueue.utility.after(timeDelay) { [weak self] in + guard let strongSelf = self else { return } + + let retrySucceeded = strongSelf.sessionManager?.retry(request) ?? false + + if retrySucceeded, let task = request.task { + strongSelf[task] = request + return + } else { + completeTask(session, task, error) + } + } + } + } else { + completeTask(session, task, error) + } + } +} + +// MARK: - URLSessionDataDelegate + +extension SessionDelegate: URLSessionDataDelegate { + /// Tells the delegate that the data task received the initial reply (headers) from the server. + /// + /// - parameter session: The session containing the data task that received an initial reply. + /// - parameter dataTask: The data task that received an initial reply. + /// - parameter response: A URL response object populated with headers. + /// - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a + /// constant to indicate whether the transfer should continue as a data task or + /// should become a download task. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didReceive response: URLResponse, + completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + { + guard dataTaskDidReceiveResponseWithCompletion == nil else { + dataTaskDidReceiveResponseWithCompletion?(session, dataTask, response, completionHandler) + return + } + + var disposition: URLSession.ResponseDisposition = .allow + + if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { + disposition = dataTaskDidReceiveResponse(session, dataTask, response) + } + + completionHandler(disposition) + } + + /// Tells the delegate that the data task was changed to a download task. + /// + /// - parameter session: The session containing the task that was replaced by a download task. + /// - parameter dataTask: The data task that was replaced by a download task. + /// - parameter downloadTask: The new download task that replaced the data task. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didBecome downloadTask: URLSessionDownloadTask) + { + if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask { + dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask) + } else { + self[downloadTask]?.delegate = DownloadTaskDelegate(task: downloadTask) + } + } + + /// Tells the delegate that the data task has received some of the expected data. + /// + /// - parameter session: The session containing the data task that provided data. + /// - parameter dataTask: The data task that provided data. + /// - parameter data: A data object containing the transferred data. + open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { + if let dataTaskDidReceiveData = dataTaskDidReceiveData { + dataTaskDidReceiveData(session, dataTask, data) + } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { + delegate.urlSession(session, dataTask: dataTask, didReceive: data) + } + } + + /// Asks the delegate whether the data (or upload) task should store the response in the cache. + /// + /// - parameter session: The session containing the data (or upload) task. + /// - parameter dataTask: The data (or upload) task. + /// - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current + /// caching policy and the values of certain received headers, such as the Pragma + /// and Cache-Control headers. + /// - parameter completionHandler: A block that your handler must call, providing either the original proposed + /// response, a modified version of that response, or NULL to prevent caching the + /// response. If your delegate implements this method, it must call this completion + /// handler; otherwise, your app leaks memory. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + willCacheResponse proposedResponse: CachedURLResponse, + completionHandler: @escaping (CachedURLResponse?) -> Void) + { + guard dataTaskWillCacheResponseWithCompletion == nil else { + dataTaskWillCacheResponseWithCompletion?(session, dataTask, proposedResponse, completionHandler) + return + } + + if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { + completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse)) + } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { + delegate.urlSession( + session, + dataTask: dataTask, + willCacheResponse: proposedResponse, + completionHandler: completionHandler + ) + } else { + completionHandler(proposedResponse) + } + } +} + +// MARK: - URLSessionDownloadDelegate + +extension SessionDelegate: URLSessionDownloadDelegate { + /// Tells the delegate that a download task has finished downloading. + /// + /// - parameter session: The session containing the download task that finished. + /// - parameter downloadTask: The download task that finished. + /// - parameter location: A file URL for the temporary file. Because the file is temporary, you must either + /// open the file for reading or move it to a permanent location in your app’s sandbox + /// container directory before returning from this delegate method. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didFinishDownloadingTo location: URL) + { + if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { + downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession(session, downloadTask: downloadTask, didFinishDownloadingTo: location) + } + } + + /// Periodically informs the delegate about the download’s progress. + /// + /// - parameter session: The session containing the download task. + /// - parameter downloadTask: The download task. + /// - parameter bytesWritten: The number of bytes transferred since the last time this delegate + /// method was called. + /// - parameter totalBytesWritten: The total number of bytes transferred so far. + /// - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length + /// header. If this header was not provided, the value is + /// `NSURLSessionTransferSizeUnknown`. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64) + { + if let downloadTaskDidWriteData = downloadTaskDidWriteData { + downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession( + session, + downloadTask: downloadTask, + didWriteData: bytesWritten, + totalBytesWritten: totalBytesWritten, + totalBytesExpectedToWrite: totalBytesExpectedToWrite + ) + } + } + + /// Tells the delegate that the download task has resumed downloading. + /// + /// - parameter session: The session containing the download task that finished. + /// - parameter downloadTask: The download task that resumed. See explanation in the discussion. + /// - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the + /// existing content, then this value is zero. Otherwise, this value is an + /// integer representing the number of bytes on disk that do not need to be + /// retrieved again. + /// - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header. + /// If this header was not provided, the value is NSURLSessionTransferSizeUnknown. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didResumeAtOffset fileOffset: Int64, + expectedTotalBytes: Int64) + { + if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { + downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession( + session, + downloadTask: downloadTask, + didResumeAtOffset: fileOffset, + expectedTotalBytes: expectedTotalBytes + ) + } + } +} + +// MARK: - URLSessionStreamDelegate + +#if !os(watchOS) + +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +extension SessionDelegate: URLSessionStreamDelegate { + /// Tells the delegate that the read side of the connection has been closed. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) { + streamTaskReadClosed?(session, streamTask) + } + + /// Tells the delegate that the write side of the connection has been closed. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) { + streamTaskWriteClosed?(session, streamTask) + } + + /// Tells the delegate that the system has determined that a better route to the host is available. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) { + streamTaskBetterRouteDiscovered?(session, streamTask) + } + + /// Tells the delegate that the stream task has been completed and provides the unopened stream objects. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + /// - parameter inputStream: The new input stream. + /// - parameter outputStream: The new output stream. + open func urlSession( + _ session: URLSession, + streamTask: URLSessionStreamTask, + didBecome inputStream: InputStream, + outputStream: OutputStream) + { + streamTaskDidBecomeInputAndOutputStreams?(session, streamTask, inputStream, outputStream) + } +} + +#endif diff --git a/client/Pods/Alamofire/Source/SessionManager.swift b/client/Pods/Alamofire/Source/SessionManager.swift new file mode 100644 index 00000000..9bd8b540 --- /dev/null +++ b/client/Pods/Alamofire/Source/SessionManager.swift @@ -0,0 +1,891 @@ +// +// SessionManager.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`. +open class SessionManager { + + // MARK: - Helper Types + + /// Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as + /// associated values. + /// + /// - Success: Represents a successful `MultipartFormData` encoding and contains the new `UploadRequest` along with + /// streaming information. + /// - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding + /// error. + public enum MultipartFormDataEncodingResult { + case success(request: UploadRequest, streamingFromDisk: Bool, streamFileURL: URL?) + case failure(Error) + } + + // MARK: - Properties + + /// A default instance of `SessionManager`, used by top-level Alamofire request methods, and suitable for use + /// directly for any ad hoc requests. + open static let `default`: SessionManager = { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders + + return SessionManager(configuration: configuration) + }() + + /// Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers. + open static let defaultHTTPHeaders: HTTPHeaders = { + // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3 + let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" + + // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 + let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { index, languageCode in + let quality = 1.0 - (Double(index) * 0.1) + return "\(languageCode);q=\(quality)" + }.joined(separator: ", ") + + // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 + // Example: `iOS Example/1.0 (org.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0` + let userAgent: String = { + if let info = Bundle.main.infoDictionary { + let executable = info[kCFBundleExecutableKey as String] as? String ?? "Unknown" + let bundle = info[kCFBundleIdentifierKey as String] as? String ?? "Unknown" + let appVersion = info["CFBundleShortVersionString"] as? String ?? "Unknown" + let appBuild = info[kCFBundleVersionKey as String] as? String ?? "Unknown" + + let osNameVersion: String = { + let version = ProcessInfo.processInfo.operatingSystemVersion + let versionString = "\(version.majorVersion).\(version.minorVersion).\(version.patchVersion)" + + let osName: String = { + #if os(iOS) + return "iOS" + #elseif os(watchOS) + return "watchOS" + #elseif os(tvOS) + return "tvOS" + #elseif os(macOS) + return "OS X" + #elseif os(Linux) + return "Linux" + #else + return "Unknown" + #endif + }() + + return "\(osName) \(versionString)" + }() + + let alamofireVersion: String = { + guard + let afInfo = Bundle(for: SessionManager.self).infoDictionary, + let build = afInfo["CFBundleShortVersionString"] + else { return "Unknown" } + + return "Alamofire/\(build)" + }() + + return "\(executable)/\(appVersion) (\(bundle); build:\(appBuild); \(osNameVersion)) \(alamofireVersion)" + } + + return "Alamofire" + }() + + return [ + "Accept-Encoding": acceptEncoding, + "Accept-Language": acceptLanguage, + "User-Agent": userAgent + ] + }() + + /// Default memory threshold used when encoding `MultipartFormData` in bytes. + open static let multipartFormDataEncodingMemoryThreshold: UInt64 = 10_000_000 + + /// The underlying session. + open let session: URLSession + + /// The session delegate handling all the task and session delegate callbacks. + open let delegate: SessionDelegate + + /// Whether to start requests immediately after being constructed. `true` by default. + open var startRequestsImmediately: Bool = true + + /// The request adapter called each time a new request is created. + open var adapter: RequestAdapter? + + /// The request retrier called each time a request encounters an error to determine whether to retry the request. + open var retrier: RequestRetrier? { + get { return delegate.retrier } + set { delegate.retrier = newValue } + } + + /// The background completion handler closure provided by the UIApplicationDelegate + /// `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background + /// completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation + /// will automatically call the handler. + /// + /// If you need to handle your own events before the handler is called, then you need to override the + /// SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished. + /// + /// `nil` by default. + open var backgroundCompletionHandler: (() -> Void)? + + let queue = DispatchQueue(label: "org.alamofire.session-manager." + UUID().uuidString) + + // MARK: - Lifecycle + + /// Creates an instance with the specified `configuration`, `delegate` and `serverTrustPolicyManager`. + /// + /// - parameter configuration: The configuration used to construct the managed session. + /// `URLSessionConfiguration.default` by default. + /// - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by + /// default. + /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust + /// challenges. `nil` by default. + /// + /// - returns: The new `SessionManager` instance. + public init( + configuration: URLSessionConfiguration = URLSessionConfiguration.default, + delegate: SessionDelegate = SessionDelegate(), + serverTrustPolicyManager: ServerTrustPolicyManager? = nil) + { + self.delegate = delegate + self.session = URLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) + + commonInit(serverTrustPolicyManager: serverTrustPolicyManager) + } + + /// Creates an instance with the specified `session`, `delegate` and `serverTrustPolicyManager`. + /// + /// - parameter session: The URL session. + /// - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate. + /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust + /// challenges. `nil` by default. + /// + /// - returns: The new `SessionManager` instance if the URL session's delegate matches; `nil` otherwise. + public init?( + session: URLSession, + delegate: SessionDelegate, + serverTrustPolicyManager: ServerTrustPolicyManager? = nil) + { + guard delegate === session.delegate else { return nil } + + self.delegate = delegate + self.session = session + + commonInit(serverTrustPolicyManager: serverTrustPolicyManager) + } + + private func commonInit(serverTrustPolicyManager: ServerTrustPolicyManager?) { + session.serverTrustPolicyManager = serverTrustPolicyManager + + delegate.sessionManager = self + + delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in + guard let strongSelf = self else { return } + DispatchQueue.main.async { strongSelf.backgroundCompletionHandler?() } + } + } + + deinit { + session.invalidateAndCancel() + } + + // MARK: - Data Request + + /// Creates a `DataRequest` to retrieve the contents of the specified `url`, `method`, `parameters`, `encoding` + /// and `headers`. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.get` by default. + /// - parameter parameters: The parameters. `nil` by default. + /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `DataRequest`. + @discardableResult + open func request( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil) + -> DataRequest + { + var originalRequest: URLRequest? + + do { + originalRequest = try URLRequest(url: url, method: method, headers: headers) + let encodedURLRequest = try encoding.encode(originalRequest!, with: parameters) + return request(encodedURLRequest) + } catch { + return request(originalRequest, failedWith: error) + } + } + + /// Creates a `DataRequest` to retrieve the contents of a URL based on the specified `urlRequest`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `DataRequest`. + open func request(_ urlRequest: URLRequestConvertible) -> DataRequest { + var originalRequest: URLRequest? + + do { + originalRequest = try urlRequest.asURLRequest() + let originalTask = DataRequest.Requestable(urlRequest: originalRequest!) + + let task = try originalTask.task(session: session, adapter: adapter, queue: queue) + let request = DataRequest(session: session, requestTask: .data(originalTask, task)) + + delegate[task] = request + + if startRequestsImmediately { request.resume() } + + return request + } catch { + return request(originalRequest, failedWith: error) + } + } + + // MARK: Private - Request Implementation + + private func request(_ urlRequest: URLRequest?, failedWith error: Error) -> DataRequest { + var requestTask: Request.RequestTask = .data(nil, nil) + + if let urlRequest = urlRequest { + let originalTask = DataRequest.Requestable(urlRequest: urlRequest) + requestTask = .data(originalTask, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + let request = DataRequest(session: session, requestTask: requestTask, error: underlyingError) + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: request, with: underlyingError) + } else { + if startRequestsImmediately { request.resume() } + } + + return request + } + + // MARK: - Download Request + + // MARK: URL Request + + /// Creates a `DownloadRequest` to retrieve the contents the specified `url`, `method`, `parameters`, `encoding`, + /// `headers` and save them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.get` by default. + /// - parameter parameters: The parameters. `nil` by default. + /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + let encodedURLRequest = try encoding.encode(urlRequest, with: parameters) + return download(encodedURLRequest, to: destination) + } catch { + return download(nil, to: destination, failedWith: error) + } + } + + /// Creates a `DownloadRequest` to retrieve the contents of a URL based on the specified `urlRequest` and save + /// them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter urlRequest: The URL request + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + _ urlRequest: URLRequestConvertible, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + do { + let urlRequest = try urlRequest.asURLRequest() + return download(.request(urlRequest), to: destination) + } catch { + return download(nil, to: destination, failedWith: error) + } + } + + // MARK: Resume Data + + /// Creates a `DownloadRequest` from the `resumeData` produced from a previous request cancellation to retrieve + /// the contents of the original request and save them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken + /// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the + /// data is written incorrectly and will always fail to resume the download. For more information about the bug and + /// possible workarounds, please refer to the following Stack Overflow post: + /// + /// - http://stackoverflow.com/a/39347461/1342462 + /// + /// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` + /// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for + /// additional information. + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + resumingWith resumeData: Data, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + return download(.resumeData(resumeData), to: destination) + } + + // MARK: Private - Download Implementation + + private func download( + _ downloadable: DownloadRequest.Downloadable, + to destination: DownloadRequest.DownloadFileDestination?) + -> DownloadRequest + { + do { + let task = try downloadable.task(session: session, adapter: adapter, queue: queue) + let download = DownloadRequest(session: session, requestTask: .download(downloadable, task)) + + download.downloadDelegate.destination = destination + + delegate[task] = download + + if startRequestsImmediately { download.resume() } + + return download + } catch { + return download(downloadable, to: destination, failedWith: error) + } + } + + private func download( + _ downloadable: DownloadRequest.Downloadable?, + to destination: DownloadRequest.DownloadFileDestination?, + failedWith error: Error) + -> DownloadRequest + { + var downloadTask: Request.RequestTask = .download(nil, nil) + + if let downloadable = downloadable { + downloadTask = .download(downloadable, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + + let download = DownloadRequest(session: session, requestTask: downloadTask, error: underlyingError) + download.downloadDelegate.destination = destination + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: download, with: underlyingError) + } else { + if startRequestsImmediately { download.resume() } + } + + return download + } + + // MARK: - Upload Request + + // MARK: File + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `file`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter file: The file to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ fileURL: URL, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(fileURL, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates a `UploadRequest` from the specified `urlRequest` for uploading the `file`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter file: The file to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.file(fileURL, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: Data + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `data`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter data: The data to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ data: Data, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(data, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `data`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter data: The data to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.data(data, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: InputStream + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `stream`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter stream: The stream to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ stream: InputStream, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(stream, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `stream`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter stream: The stream to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.stream(stream, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: MultipartFormData + + /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new + /// `UploadRequest` using the `url`, `method` and `headers`. + /// + /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative + /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most + /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to + /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory + /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be + /// used for larger payloads such as video content. + /// + /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory + /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, + /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk + /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding + /// technique was used. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. + /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. + /// `multipartFormDataEncodingMemoryThreshold` by default. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. + open func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil, + encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + + return upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + with: urlRequest, + encodingCompletion: encodingCompletion + ) + } catch { + DispatchQueue.main.async { encodingCompletion?(.failure(error)) } + } + } + + /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new + /// `UploadRequest` using the `urlRequest`. + /// + /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative + /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most + /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to + /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory + /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be + /// used for larger payloads such as video content. + /// + /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory + /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, + /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk + /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding + /// technique was used. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. + /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. + /// `multipartFormDataEncodingMemoryThreshold` by default. + /// - parameter urlRequest: The URL request. + /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. + open func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + with urlRequest: URLRequestConvertible, + encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) + { + DispatchQueue.global(qos: .utility).async { + let formData = MultipartFormData() + multipartFormData(formData) + + var tempFileURL: URL? + + do { + var urlRequestWithContentType = try urlRequest.asURLRequest() + urlRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type") + + let isBackgroundSession = self.session.configuration.identifier != nil + + if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession { + let data = try formData.encode() + + let encodingResult = MultipartFormDataEncodingResult.success( + request: self.upload(data, with: urlRequestWithContentType), + streamingFromDisk: false, + streamFileURL: nil + ) + + DispatchQueue.main.async { encodingCompletion?(encodingResult) } + } else { + let fileManager = FileManager.default + let tempDirectoryURL = URL(fileURLWithPath: NSTemporaryDirectory()) + let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data") + let fileName = UUID().uuidString + let fileURL = directoryURL.appendingPathComponent(fileName) + + tempFileURL = fileURL + + var directoryError: Error? + + // Create directory inside serial queue to ensure two threads don't do this in parallel + self.queue.sync { + do { + try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil) + } catch { + directoryError = error + } + } + + if let directoryError = directoryError { throw directoryError } + + try formData.writeEncodedData(to: fileURL) + + let upload = self.upload(fileURL, with: urlRequestWithContentType) + + // Cleanup the temp file once the upload is complete + upload.delegate.queue.addOperation { + do { + try FileManager.default.removeItem(at: fileURL) + } catch { + // No-op + } + } + + DispatchQueue.main.async { + let encodingResult = MultipartFormDataEncodingResult.success( + request: upload, + streamingFromDisk: true, + streamFileURL: fileURL + ) + + encodingCompletion?(encodingResult) + } + } + } catch { + // Cleanup the temp file in the event that the multipart form data encoding failed + if let tempFileURL = tempFileURL { + do { + try FileManager.default.removeItem(at: tempFileURL) + } catch { + // No-op + } + } + + DispatchQueue.main.async { encodingCompletion?(.failure(error)) } + } + } + } + + // MARK: Private - Upload Implementation + + private func upload(_ uploadable: UploadRequest.Uploadable) -> UploadRequest { + do { + let task = try uploadable.task(session: session, adapter: adapter, queue: queue) + let upload = UploadRequest(session: session, requestTask: .upload(uploadable, task)) + + if case let .stream(inputStream, _) = uploadable { + upload.delegate.taskNeedNewBodyStream = { _, _ in inputStream } + } + + delegate[task] = upload + + if startRequestsImmediately { upload.resume() } + + return upload + } catch { + return upload(uploadable, failedWith: error) + } + } + + private func upload(_ uploadable: UploadRequest.Uploadable?, failedWith error: Error) -> UploadRequest { + var uploadTask: Request.RequestTask = .upload(nil, nil) + + if let uploadable = uploadable { + uploadTask = .upload(uploadable, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + let upload = UploadRequest(session: session, requestTask: uploadTask, error: underlyingError) + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: upload, with: underlyingError) + } else { + if startRequestsImmediately { upload.resume() } + } + + return upload + } + +#if !os(watchOS) + + // MARK: - Stream Request + + // MARK: Hostname and Port + + /// Creates a `StreamRequest` for bidirectional streaming using the `hostname` and `port`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter hostName: The hostname of the server to connect to. + /// - parameter port: The port of the server to connect to. + /// + /// - returns: The created `StreamRequest`. + @discardableResult + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open func stream(withHostName hostName: String, port: Int) -> StreamRequest { + return stream(.stream(hostName: hostName, port: port)) + } + + // MARK: NetService + + /// Creates a `StreamRequest` for bidirectional streaming using the `netService`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter netService: The net service used to identify the endpoint. + /// + /// - returns: The created `StreamRequest`. + @discardableResult + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open func stream(with netService: NetService) -> StreamRequest { + return stream(.netService(netService)) + } + + // MARK: Private - Stream Implementation + + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + private func stream(_ streamable: StreamRequest.Streamable) -> StreamRequest { + do { + let task = try streamable.task(session: session, adapter: adapter, queue: queue) + let request = StreamRequest(session: session, requestTask: .stream(streamable, task)) + + delegate[task] = request + + if startRequestsImmediately { request.resume() } + + return request + } catch { + return stream(failedWith: error) + } + } + + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + private func stream(failedWith error: Error) -> StreamRequest { + let stream = StreamRequest(session: session, requestTask: .stream(nil, nil), error: error) + if startRequestsImmediately { stream.resume() } + return stream + } + +#endif + + // MARK: - Internal - Retry Request + + func retry(_ request: Request) -> Bool { + guard let originalTask = request.originalTask else { return false } + + do { + let task = try originalTask.task(session: session, adapter: adapter, queue: queue) + + request.delegate.task = task // resets all task delegate data + + request.retryCount += 1 + request.startTime = CFAbsoluteTimeGetCurrent() + request.endTime = nil + + task.resume() + + return true + } catch { + request.delegate.error = error.underlyingAdaptError ?? error + return false + } + } + + private func allowRetrier(_ retrier: RequestRetrier, toRetry request: Request, with error: Error) { + DispatchQueue.utility.async { [weak self] in + guard let strongSelf = self else { return } + + retrier.should(strongSelf, retry: request, with: error) { shouldRetry, timeDelay in + guard let strongSelf = self else { return } + + guard shouldRetry else { + if strongSelf.startRequestsImmediately { request.resume() } + return + } + + DispatchQueue.utility.after(timeDelay) { + guard let strongSelf = self else { return } + + let retrySucceeded = strongSelf.retry(request) + + if retrySucceeded, let task = request.task { + strongSelf.delegate[task] = request + } else { + if strongSelf.startRequestsImmediately { request.resume() } + } + } + } + } + } +} diff --git a/client/Pods/Alamofire/Source/TaskDelegate.swift b/client/Pods/Alamofire/Source/TaskDelegate.swift new file mode 100644 index 00000000..06077587 --- /dev/null +++ b/client/Pods/Alamofire/Source/TaskDelegate.swift @@ -0,0 +1,466 @@ +// +// TaskDelegate.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// The task delegate is responsible for handling all delegate callbacks for the underlying task as well as +/// executing all operations attached to the serial operation queue upon task completion. +open class TaskDelegate: NSObject { + + // MARK: Properties + + /// The serial operation queue used to execute all operations after the task completes. + open let queue: OperationQueue + + /// The data returned by the server. + public var data: Data? { return nil } + + /// The error generated throughout the lifecyle of the task. + public var error: Error? + + var task: URLSessionTask? { + set { + taskLock.lock(); defer { taskLock.unlock() } + _task = newValue + } + get { + taskLock.lock(); defer { taskLock.unlock() } + return _task + } + } + + var initialResponseTime: CFAbsoluteTime? + var credential: URLCredential? + var metrics: AnyObject? // URLSessionTaskMetrics + + private var _task: URLSessionTask? { + didSet { reset() } + } + + private let taskLock = NSLock() + + // MARK: Lifecycle + + init(task: URLSessionTask?) { + _task = task + + self.queue = { + let operationQueue = OperationQueue() + + operationQueue.maxConcurrentOperationCount = 1 + operationQueue.isSuspended = true + operationQueue.qualityOfService = .utility + + return operationQueue + }() + } + + func reset() { + error = nil + initialResponseTime = nil + } + + // MARK: URLSessionTaskDelegate + + var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? + var taskDidCompleteWithError: ((URLSession, URLSessionTask, Error?) -> Void)? + + @objc(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + willPerformHTTPRedirection response: HTTPURLResponse, + newRequest request: URLRequest, + completionHandler: @escaping (URLRequest?) -> Void) + { + var redirectRequest: URLRequest? = request + + if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { + redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) + } + + completionHandler(redirectRequest) + } + + @objc(URLSession:task:didReceiveChallenge:completionHandler:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + var credential: URLCredential? + + if let taskDidReceiveChallenge = taskDidReceiveChallenge { + (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) + } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { + let host = challenge.protectionSpace.host + + if + let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), + let serverTrust = challenge.protectionSpace.serverTrust + { + if serverTrustPolicy.evaluate(serverTrust, forHost: host) { + disposition = .useCredential + credential = URLCredential(trust: serverTrust) + } else { + disposition = .cancelAuthenticationChallenge + } + } + } else { + if challenge.previousFailureCount > 0 { + disposition = .rejectProtectionSpace + } else { + credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + + if credential != nil { + disposition = .useCredential + } + } + } + + completionHandler(disposition, credential) + } + + @objc(URLSession:task:needNewBodyStream:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) + { + var bodyStream: InputStream? + + if let taskNeedNewBodyStream = taskNeedNewBodyStream { + bodyStream = taskNeedNewBodyStream(session, task) + } + + completionHandler(bodyStream) + } + + @objc(URLSession:task:didCompleteWithError:) + func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + if let taskDidCompleteWithError = taskDidCompleteWithError { + taskDidCompleteWithError(session, task, error) + } else { + if let error = error { + if self.error == nil { self.error = error } + + if + let downloadDelegate = self as? DownloadTaskDelegate, + let resumeData = (error as NSError).userInfo[NSURLSessionDownloadTaskResumeData] as? Data + { + downloadDelegate.resumeData = resumeData + } + } + + queue.isSuspended = false + } + } +} + +// MARK: - + +class DataTaskDelegate: TaskDelegate, URLSessionDataDelegate { + + // MARK: Properties + + var dataTask: URLSessionDataTask { return task as! URLSessionDataTask } + + override var data: Data? { + if dataStream != nil { + return nil + } else { + return mutableData + } + } + + var progress: Progress + var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + var dataStream: ((_ data: Data) -> Void)? + + private var totalBytesReceived: Int64 = 0 + private var mutableData: Data + + private var expectedContentLength: Int64? + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + mutableData = Data() + progress = Progress(totalUnitCount: 0) + + super.init(task: task) + } + + override func reset() { + super.reset() + + progress = Progress(totalUnitCount: 0) + totalBytesReceived = 0 + mutableData = Data() + expectedContentLength = nil + } + + // MARK: URLSessionDataDelegate + + var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? + var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? + var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? + var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didReceive response: URLResponse, + completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + { + var disposition: URLSession.ResponseDisposition = .allow + + expectedContentLength = response.expectedContentLength + + if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { + disposition = dataTaskDidReceiveResponse(session, dataTask, response) + } + + completionHandler(disposition) + } + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didBecome downloadTask: URLSessionDownloadTask) + { + dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask) + } + + func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let dataTaskDidReceiveData = dataTaskDidReceiveData { + dataTaskDidReceiveData(session, dataTask, data) + } else { + if let dataStream = dataStream { + dataStream(data) + } else { + mutableData.append(data) + } + + let bytesReceived = Int64(data.count) + totalBytesReceived += bytesReceived + let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown + + progress.totalUnitCount = totalBytesExpected + progress.completedUnitCount = totalBytesReceived + + if let progressHandler = progressHandler { + progressHandler.queue.async { progressHandler.closure(self.progress) } + } + } + } + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + willCacheResponse proposedResponse: CachedURLResponse, + completionHandler: @escaping (CachedURLResponse?) -> Void) + { + var cachedResponse: CachedURLResponse? = proposedResponse + + if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { + cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse) + } + + completionHandler(cachedResponse) + } +} + +// MARK: - + +class DownloadTaskDelegate: TaskDelegate, URLSessionDownloadDelegate { + + // MARK: Properties + + var downloadTask: URLSessionDownloadTask { return task as! URLSessionDownloadTask } + + var progress: Progress + var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + var resumeData: Data? + override var data: Data? { return resumeData } + + var destination: DownloadRequest.DownloadFileDestination? + + var temporaryURL: URL? + var destinationURL: URL? + + var fileURL: URL? { return destination != nil ? destinationURL : temporaryURL } + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + progress = Progress(totalUnitCount: 0) + super.init(task: task) + } + + override func reset() { + super.reset() + + progress = Progress(totalUnitCount: 0) + resumeData = nil + } + + // MARK: URLSessionDownloadDelegate + + var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> URL)? + var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? + var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didFinishDownloadingTo location: URL) + { + temporaryURL = location + + guard + let destination = destination, + let response = downloadTask.response as? HTTPURLResponse + else { return } + + let result = destination(location, response) + let destinationURL = result.destinationURL + let options = result.options + + self.destinationURL = destinationURL + + do { + if options.contains(.removePreviousFile), FileManager.default.fileExists(atPath: destinationURL.path) { + try FileManager.default.removeItem(at: destinationURL) + } + + if options.contains(.createIntermediateDirectories) { + let directory = destinationURL.deletingLastPathComponent() + try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true) + } + + try FileManager.default.moveItem(at: location, to: destinationURL) + } catch { + self.error = error + } + } + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64) + { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let downloadTaskDidWriteData = downloadTaskDidWriteData { + downloadTaskDidWriteData( + session, + downloadTask, + bytesWritten, + totalBytesWritten, + totalBytesExpectedToWrite + ) + } else { + progress.totalUnitCount = totalBytesExpectedToWrite + progress.completedUnitCount = totalBytesWritten + + if let progressHandler = progressHandler { + progressHandler.queue.async { progressHandler.closure(self.progress) } + } + } + } + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didResumeAtOffset fileOffset: Int64, + expectedTotalBytes: Int64) + { + if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { + downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) + } else { + progress.totalUnitCount = expectedTotalBytes + progress.completedUnitCount = fileOffset + } + } +} + +// MARK: - + +class UploadTaskDelegate: DataTaskDelegate { + + // MARK: Properties + + var uploadTask: URLSessionUploadTask { return task as! URLSessionUploadTask } + + var uploadProgress: Progress + var uploadProgressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + uploadProgress = Progress(totalUnitCount: 0) + super.init(task: task) + } + + override func reset() { + super.reset() + uploadProgress = Progress(totalUnitCount: 0) + } + + // MARK: URLSessionTaskDelegate + + var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? + + func URLSession( + _ session: URLSession, + task: URLSessionTask, + didSendBodyData bytesSent: Int64, + totalBytesSent: Int64, + totalBytesExpectedToSend: Int64) + { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let taskDidSendBodyData = taskDidSendBodyData { + taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) + } else { + uploadProgress.totalUnitCount = totalBytesExpectedToSend + uploadProgress.completedUnitCount = totalBytesSent + + if let uploadProgressHandler = uploadProgressHandler { + uploadProgressHandler.queue.async { uploadProgressHandler.closure(self.uploadProgress) } + } + } + } +} diff --git a/client/Pods/Alamofire/Source/Timeline.swift b/client/Pods/Alamofire/Source/Timeline.swift new file mode 100644 index 00000000..c5dabd14 --- /dev/null +++ b/client/Pods/Alamofire/Source/Timeline.swift @@ -0,0 +1,136 @@ +// +// Timeline.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`. +public struct Timeline { + /// The time the request was initialized. + public let requestStartTime: CFAbsoluteTime + + /// The time the first bytes were received from or sent to the server. + public let initialResponseTime: CFAbsoluteTime + + /// The time when the request was completed. + public let requestCompletedTime: CFAbsoluteTime + + /// The time when the response serialization was completed. + public let serializationCompletedTime: CFAbsoluteTime + + /// The time interval in seconds from the time the request started to the initial response from the server. + public let latency: TimeInterval + + /// The time interval in seconds from the time the request started to the time the request completed. + public let requestDuration: TimeInterval + + /// The time interval in seconds from the time the request completed to the time response serialization completed. + public let serializationDuration: TimeInterval + + /// The time interval in seconds from the time the request started to the time response serialization completed. + public let totalDuration: TimeInterval + + /// Creates a new `Timeline` instance with the specified request times. + /// + /// - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`. + /// - parameter initialResponseTime: The time the first bytes were received from or sent to the server. + /// Defaults to `0.0`. + /// - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`. + /// - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults + /// to `0.0`. + /// + /// - returns: The new `Timeline` instance. + public init( + requestStartTime: CFAbsoluteTime = 0.0, + initialResponseTime: CFAbsoluteTime = 0.0, + requestCompletedTime: CFAbsoluteTime = 0.0, + serializationCompletedTime: CFAbsoluteTime = 0.0) + { + self.requestStartTime = requestStartTime + self.initialResponseTime = initialResponseTime + self.requestCompletedTime = requestCompletedTime + self.serializationCompletedTime = serializationCompletedTime + + self.latency = initialResponseTime - requestStartTime + self.requestDuration = requestCompletedTime - requestStartTime + self.serializationDuration = serializationCompletedTime - requestCompletedTime + self.totalDuration = serializationCompletedTime - requestStartTime + } +} + +// MARK: - CustomStringConvertible + +extension Timeline: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes the latency, the request + /// duration and the total duration. + public var description: String { + let latency = String(format: "%.3f", self.latency) + let requestDuration = String(format: "%.3f", self.requestDuration) + let serializationDuration = String(format: "%.3f", self.serializationDuration) + let totalDuration = String(format: "%.3f", self.totalDuration) + + // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is + // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. + let timings = [ + "\"Latency\": " + latency + " secs", + "\"Request Duration\": " + requestDuration + " secs", + "\"Serialization Duration\": " + serializationDuration + " secs", + "\"Total Duration\": " + totalDuration + " secs" + ] + + return "Timeline: { " + timings.joined(separator: ", ") + " }" + } +} + +// MARK: - CustomDebugStringConvertible + +extension Timeline: CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes the request start time, the + /// initial response time, the request completed time, the serialization completed time, the latency, the request + /// duration and the total duration. + public var debugDescription: String { + let requestStartTime = String(format: "%.3f", self.requestStartTime) + let initialResponseTime = String(format: "%.3f", self.initialResponseTime) + let requestCompletedTime = String(format: "%.3f", self.requestCompletedTime) + let serializationCompletedTime = String(format: "%.3f", self.serializationCompletedTime) + let latency = String(format: "%.3f", self.latency) + let requestDuration = String(format: "%.3f", self.requestDuration) + let serializationDuration = String(format: "%.3f", self.serializationDuration) + let totalDuration = String(format: "%.3f", self.totalDuration) + + // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is + // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. + let timings = [ + "\"Request Start Time\": " + requestStartTime, + "\"Initial Response Time\": " + initialResponseTime, + "\"Request Completed Time\": " + requestCompletedTime, + "\"Serialization Completed Time\": " + serializationCompletedTime, + "\"Latency\": " + latency + " secs", + "\"Request Duration\": " + requestDuration + " secs", + "\"Serialization Duration\": " + serializationDuration + " secs", + "\"Total Duration\": " + totalDuration + " secs" + ] + + return "Timeline: { " + timings.joined(separator: ", ") + " }" + } +} diff --git a/client/Pods/Alamofire/Source/Validation.swift b/client/Pods/Alamofire/Source/Validation.swift new file mode 100644 index 00000000..989ac200 --- /dev/null +++ b/client/Pods/Alamofire/Source/Validation.swift @@ -0,0 +1,315 @@ +// +// Validation.swift +// +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +extension Request { + + // MARK: Helper Types + + fileprivate typealias ErrorReason = AFError.ResponseValidationFailureReason + + /// Used to represent whether validation was successful or encountered an error resulting in a failure. + /// + /// - success: The validation was successful. + /// - failure: The validation failed encountering the provided error. + public enum ValidationResult { + case success + case failure(Error) + } + + fileprivate struct MIMEType { + let type: String + let subtype: String + + var isWildcard: Bool { return type == "*" && subtype == "*" } + + init?(_ string: String) { + let components: [String] = { + let stripped = string.trimmingCharacters(in: .whitespacesAndNewlines) + + #if swift(>=3.2) + let split = stripped[..<(stripped.range(of: ";")?.lowerBound ?? stripped.endIndex)] + #else + let split = stripped.substring(to: stripped.range(of: ";")?.lowerBound ?? stripped.endIndex) + #endif + + return split.components(separatedBy: "/") + }() + + if let type = components.first, let subtype = components.last { + self.type = type + self.subtype = subtype + } else { + return nil + } + } + + func matches(_ mime: MIMEType) -> Bool { + switch (type, subtype) { + case (mime.type, mime.subtype), (mime.type, "*"), ("*", mime.subtype), ("*", "*"): + return true + default: + return false + } + } + } + + // MARK: Properties + + fileprivate var acceptableStatusCodes: [Int] { return Array(200..<300) } + + fileprivate var acceptableContentTypes: [String] { + if let accept = request?.value(forHTTPHeaderField: "Accept") { + return accept.components(separatedBy: ",") + } + + return ["*/*"] + } + + // MARK: Status Code + + fileprivate func validate( + statusCode acceptableStatusCodes: S, + response: HTTPURLResponse) + -> ValidationResult + where S.Iterator.Element == Int + { + if acceptableStatusCodes.contains(response.statusCode) { + return .success + } else { + let reason: ErrorReason = .unacceptableStatusCode(code: response.statusCode) + return .failure(AFError.responseValidationFailed(reason: reason)) + } + } + + // MARK: Content Type + + fileprivate func validate( + contentType acceptableContentTypes: S, + response: HTTPURLResponse, + data: Data?) + -> ValidationResult + where S.Iterator.Element == String + { + guard let data = data, data.count > 0 else { return .success } + + guard + let responseContentType = response.mimeType, + let responseMIMEType = MIMEType(responseContentType) + else { + for contentType in acceptableContentTypes { + if let mimeType = MIMEType(contentType), mimeType.isWildcard { + return .success + } + } + + let error: AFError = { + let reason: ErrorReason = .missingContentType(acceptableContentTypes: Array(acceptableContentTypes)) + return AFError.responseValidationFailed(reason: reason) + }() + + return .failure(error) + } + + for contentType in acceptableContentTypes { + if let acceptableMIMEType = MIMEType(contentType), acceptableMIMEType.matches(responseMIMEType) { + return .success + } + } + + let error: AFError = { + let reason: ErrorReason = .unacceptableContentType( + acceptableContentTypes: Array(acceptableContentTypes), + responseContentType: responseContentType + ) + + return AFError.responseValidationFailed(reason: reason) + }() + + return .failure(error) + } +} + +// MARK: - + +extension DataRequest { + /// A closure used to validate a request that takes a URL request, a URL response and data, and returns whether the + /// request was valid. + public typealias Validation = (URLRequest?, HTTPURLResponse, Data?) -> ValidationResult + + /// Validates the request, using the specified closure. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter validation: A closure to validate the request. + /// + /// - returns: The request. + @discardableResult + public func validate(_ validation: @escaping Validation) -> Self { + let validationExecution: () -> Void = { [unowned self] in + if + let response = self.response, + self.delegate.error == nil, + case let .failure(error) = validation(self.request, response, self.delegate.data) + { + self.delegate.error = error + } + } + + validations.append(validationExecution) + + return self + } + + /// Validates that the response has a status code in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter range: The range of acceptable status codes. + /// + /// - returns: The request. + @discardableResult + public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { + return validate { [unowned self] _, response, _ in + return self.validate(statusCode: acceptableStatusCodes, response: response) + } + } + + /// Validates that the response has a content type in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. + /// + /// - returns: The request. + @discardableResult + public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { + return validate { [unowned self] _, response, data in + return self.validate(contentType: acceptableContentTypes, response: response, data: data) + } + } + + /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content + /// type matches any specified in the Accept HTTP header field. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - returns: The request. + @discardableResult + public func validate() -> Self { + return validate(statusCode: self.acceptableStatusCodes).validate(contentType: self.acceptableContentTypes) + } +} + +// MARK: - + +extension DownloadRequest { + /// A closure used to validate a request that takes a URL request, a URL response, a temporary URL and a + /// destination URL, and returns whether the request was valid. + public typealias Validation = ( + _ request: URLRequest?, + _ response: HTTPURLResponse, + _ temporaryURL: URL?, + _ destinationURL: URL?) + -> ValidationResult + + /// Validates the request, using the specified closure. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter validation: A closure to validate the request. + /// + /// - returns: The request. + @discardableResult + public func validate(_ validation: @escaping Validation) -> Self { + let validationExecution: () -> Void = { [unowned self] in + let request = self.request + let temporaryURL = self.downloadDelegate.temporaryURL + let destinationURL = self.downloadDelegate.destinationURL + + if + let response = self.response, + self.delegate.error == nil, + case let .failure(error) = validation(request, response, temporaryURL, destinationURL) + { + self.delegate.error = error + } + } + + validations.append(validationExecution) + + return self + } + + /// Validates that the response has a status code in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter range: The range of acceptable status codes. + /// + /// - returns: The request. + @discardableResult + public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { + return validate { [unowned self] _, response, _, _ in + return self.validate(statusCode: acceptableStatusCodes, response: response) + } + } + + /// Validates that the response has a content type in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. + /// + /// - returns: The request. + @discardableResult + public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { + return validate { [unowned self] _, response, _, _ in + let fileURL = self.downloadDelegate.fileURL + + guard let validFileURL = fileURL else { + return .failure(AFError.responseValidationFailed(reason: .dataFileNil)) + } + + do { + let data = try Data(contentsOf: validFileURL) + return self.validate(contentType: acceptableContentTypes, response: response, data: data) + } catch { + return .failure(AFError.responseValidationFailed(reason: .dataFileReadFailed(at: validFileURL))) + } + } + } + + /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content + /// type matches any specified in the Accept HTTP header field. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - returns: The request. + @discardableResult + public func validate() -> Self { + return validate(statusCode: self.acceptableStatusCodes).validate(contentType: self.acceptableContentTypes) + } +} diff --git a/client/Pods/FontAwesome.swift/FontAwesome/Enum.swift b/client/Pods/FontAwesome.swift/FontAwesome/Enum.swift new file mode 100644 index 00000000..1dc29b18 --- /dev/null +++ b/client/Pods/FontAwesome.swift/FontAwesome/Enum.swift @@ -0,0 +1,1584 @@ +// Enum.swift +// +// Copyright (c) 2014-present FontAwesome.swift contributors +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +/// An enumaration of FontAwesome icon names. +// swiftlint:disable file_length type_body_length +public enum FontAwesome: String { + case fiveHundredPixels = "\u{f26e}" + case addressBook = "\u{f2b9}" + case addressBookO = "\u{f2ba}" + case addressCard = "\u{f2bb}" + case addressCardO = "\u{f2bc}" + case adjust = "\u{f042}" + case adn = "\u{f170}" + case alignCenter = "\u{f037}" + case alignJustify = "\u{f039}" + case alignLeft = "\u{f036}" + case alignRight = "\u{f038}" + case amazon = "\u{f270}" + case ambulance = "\u{f0f9}" + case americanSignLanguageInterpreting = "\u{f2a3}" + case anchor = "\u{f13d}" + case android = "\u{f17b}" + case angellist = "\u{f209}" + case angleDoubleDown = "\u{f103}" + case angleDoubleLeft = "\u{f100}" + case angleDoubleRight = "\u{f101}" + case angleDoubleUp = "\u{f102}" + case angleDown = "\u{f107}" + case angleLeft = "\u{f104}" + case angleRight = "\u{f105}" + case angleUp = "\u{f106}" + case apple = "\u{f179}" + case archive = "\u{f187}" + case areaChart = "\u{f1fe}" + case arrowCircleDown = "\u{f0ab}" + case arrowCircleLeft = "\u{f0a8}" + case arrowCircleODown = "\u{f01a}" + case arrowCircleOLeft = "\u{f190}" + case arrowCircleORight = "\u{f18e}" + case arrowCircleOUp = "\u{f01b}" + case arrowCircleRight = "\u{f0a9}" + case arrowCircleUp = "\u{f0aa}" + case arrowDown = "\u{f063}" + case arrowLeft = "\u{f060}" + case arrowRight = "\u{f061}" + case arrowUp = "\u{f062}" + case arrows = "\u{f047}" + case arrowsAlt = "\u{f0b2}" + case arrowsH = "\u{f07e}" + case arrowsV = "\u{f07d}" + case aslInterpreting = "\u{f2a3}A" + case assistiveListeningSystems = "\u{f2a2}" + case asterisk = "\u{f069}" + case at = "\u{f1fa}" + case audioDescription = "\u{f29e}" + case automobile = "\u{f1b9}A" + case backward = "\u{f04a}" + case balanceScale = "\u{f24e}" + case ban = "\u{f05e}" + case bandCamp = "\u{f2d5}" + case bank = "\u{f19c}A" + case barChart = "\u{f080}" + case barChartO = "\u{f080}A" + case barcode = "\u{f02a}" + case bars = "\u{f0c9}" + case bath = "\u{f2cd}" + case battery0 = "\u{f244}A" + case battery1 = "\u{f243}A" + case battery2 = "\u{f242}A" + case battery3 = "\u{f241}A" + case battery4 = "\u{f240}A" + case batteryEmpty = "\u{f244}" + case batteryFull = "\u{f240}" + case batteryHalf = "\u{f242}" + case batteryQuarter = "\u{f243}" + case batteryThreeQuarters = "\u{f241}" + case bed = "\u{f236}" + case beer = "\u{f0fc}" + case behance = "\u{f1b4}" + case behanceSquare = "\u{f1b5}" + case bell = "\u{f0f3}" + case bellO = "\u{f0a2}" + case bellSlash = "\u{f1f6}" + case bellSlashO = "\u{f1f7}" + case bicycle = "\u{f206}" + case binoculars = "\u{f1e5}" + case birthdayCake = "\u{f1fd}" + case bitbucket = "\u{f171}" + case bitbucketSquare = "\u{f172}" + case bitcoin = "\u{f15a}A" + case blackTie = "\u{f27e}" + case blind = "\u{f29d}" + case bluetooth = "\u{f293}" + case bluetoothB = "\u{f294}" + case bold = "\u{f032}" + case bolt = "\u{f0e7}" + case bomb = "\u{f1e2}" + case book = "\u{f02d}" + case bookmark = "\u{f02e}" + case bookmarkO = "\u{f097}" + case braille = "\u{f2a1}" + case briefcase = "\u{f0b1}" + case btc = "\u{f15a}" + case bug = "\u{f188}" + case building = "\u{f1ad}" + case buildingO = "\u{f0f7}" + case bullhorn = "\u{f0a1}" + case bullseye = "\u{f140}" + case bus = "\u{f207}" + case buysellads = "\u{f20d}" + case cab = "\u{f1ba}A" + case calculator = "\u{f1ec}" + case calendar = "\u{f073}" + case calendarCheckO = "\u{f274}" + case calendarMinusO = "\u{f272}" + case calendarO = "\u{f133}" + case calendarPlusO = "\u{f271}" + case calendarTimesO = "\u{f273}" + case camera = "\u{f030}" + case cameraRetro = "\u{f083}" + case car = "\u{f1b9}" + case caretDown = "\u{f0d7}" + case caretLeft = "\u{f0d9}" + case caretRight = "\u{f0da}" + case caretSquareODown = "\u{f150}" + case caretSquareOLeft = "\u{f191}" + case caretSquareORight = "\u{f152}" + case caretSquareOUp = "\u{f151}" + case caretUp = "\u{f0d8}" + case cartArrowDown = "\u{f218}" + case cartPlus = "\u{f217}" + case cc = "\u{f20a}" + case ccAmex = "\u{f1f3}" + case ccDinersClub = "\u{f24c}" + case ccDiscover = "\u{f1f2}" + case ccJCB = "\u{f24b}" + case ccMasterCard = "\u{f1f1}" + case ccPaypal = "\u{f1f4}" + case ccStripe = "\u{f1f5}" + case ccVisa = "\u{f1f0}" + case certificate = "\u{f0a3}" + case chain = "\u{f0c1}A" + case chainBroken = "\u{f127}" + case check = "\u{f00c}" + case checkCircle = "\u{f058}" + case checkCircleO = "\u{f05d}" + case checkSquare = "\u{f14a}" + case checkSquareO = "\u{f046}" + case chevronCircleDown = "\u{f13a}" + case chevronCircleLeft = "\u{f137}" + case chevronCircleRight = "\u{f138}" + case chevronCircleUp = "\u{f139}" + case chevronDown = "\u{f078}" + case chevronLeft = "\u{f053}" + case chevronRight = "\u{f054}" + case chevronUp = "\u{f077}" + case child = "\u{f1ae}" + case chrome = "\u{f268}" + case circle = "\u{f111}" + case circleO = "\u{f10c}" + case circleONotch = "\u{f1ce}" + case circleThin = "\u{f1db}" + case clipboard = "\u{f0ea}" + case clockO = "\u{f017}" + case clone = "\u{f24d}" + case close = "\u{f00d}A" + case cloud = "\u{f0c2}" + case cloudDownload = "\u{f0ed}" + case cloudUpload = "\u{f0ee}" + case cny = "\u{f157}A" + case code = "\u{f121}" + case codeFork = "\u{f126}" + case codepen = "\u{f1cb}" + case codiepie = "\u{f284}" + case coffee = "\u{f0f4}" + case cog = "\u{f013}" + case cogs = "\u{f085}" + case columns = "\u{f0db}" + case comment = "\u{f075}" + case commentO = "\u{f0e5}" + case commenting = "\u{f27a}" + case commentingO = "\u{f27b}" + case comments = "\u{f086}" + case commentsO = "\u{f0e6}" + case compass = "\u{f14e}" + case compress = "\u{f066}" + case connectdevelop = "\u{f20e}" + case contao = "\u{f26d}" + case copy = "\u{f0c5}A" + case copyright = "\u{f1f9}" + case creativeCommons = "\u{f25e}" + case creditCard = "\u{f09d}" + case creditCardAlt = "\u{f283}" + case crop = "\u{f125}" + case crosshairs = "\u{f05b}" + case css3 = "\u{f13c}" + case cube = "\u{f1b2}" + case cubes = "\u{f1b3}" + case cut = "\u{f0c4}A" + case cutlery = "\u{f0f5}" + case dashboard = "\u{f0e4}A" + case dashcube = "\u{f210}" + case database = "\u{f1c0}" + case deaf = "\u{f2a4}" + case deafness = "\u{f2a4}A" + case dedent = "\u{f03b}A" + case delicious = "\u{f1a5}" + case desktop = "\u{f108}" + case deviantart = "\u{f1bd}" + case diamond = "\u{f219}" + case digg = "\u{f1a6}" + case dollar = "\u{f155}A" + case dotCircleO = "\u{f192}" + case download = "\u{f019}" + case dribbble = "\u{f17d}" + case dropbox = "\u{f16b}" + case drupal = "\u{f1a9}" + case edge = "\u{f282}" + case edit = "\u{f044}A" + case eercast = "\u{f2da}" + case eject = "\u{f052}" + case ellipsisH = "\u{f141}" + case ellipsisV = "\u{f142}" + case empire = "\u{f1d1}" + case envelope = "\u{f0e0}" + case envelopeO = "\u{f003}" + case envelopeOpen = "\u{f2b6}" + case envelopeOpenO = "\u{f2b7}" + case envelopeSquare = "\u{f199}" + case envira = "\u{f299}" + case eraser = "\u{f12d}" + case etsy = "\u{f2d7}" + case eur = "\u{f153}" + case euro = "\u{f153}A" + case exchange = "\u{f0ec}" + case exclamation = "\u{f12a}" + case exclamationCircle = "\u{f06a}" + case exclamationTriangle = "\u{f071}" + case expand = "\u{f065}" + case expeditedSSL = "\u{f23e}" + case externalLink = "\u{f08e}" + case externalLinkSquare = "\u{f14c}" + case eye = "\u{f06e}" + case eyeSlash = "\u{f070}" + case eyedropper = "\u{f1fb}" + case fa = "\u{f2b4}A" + case facebook = "\u{f09a}" + case facebookF = "\u{f09a}A" + case facebookOfficial = "\u{f230}" + case facebookSquare = "\u{f082}" + case fastBackward = "\u{f049}" + case fastForward = "\u{f050}" + case fax = "\u{f1ac}" + case feed = "\u{f09e}A" + case female = "\u{f182}" + case fighterJet = "\u{f0fb}" + case file = "\u{f15b}" + case fileArchiveO = "\u{f1c6}" + case fileAudioO = "\u{f1c7}" + case fileCodeO = "\u{f1c9}" + case fileExcelO = "\u{f1c3}" + case fileImageO = "\u{f1c5}" + case fileMovieO = "\u{f1c8}A" + case fileO = "\u{f016}" + case filePdfO = "\u{f1c1}" + case filePhotoO = "\u{f1c5}A" + case filePictureO = "\u{f1c5}B" + case filePowerpointO = "\u{f1c4}" + case fileSoundO = "\u{f1c7}A" + case fileText = "\u{f15c}" + case fileTextO = "\u{f0f6}" + case fileVideoO = "\u{f1c8}" + case fileWordO = "\u{f1c2}" + case fileZipO = "\u{f1c6}A" + case filesO = "\u{f0c5}" + case film = "\u{f008}" + case filter = "\u{f0b0}" + case fire = "\u{f06d}" + case fireExtinguisher = "\u{f134}" + case firefox = "\u{f269}" + case firstOrder = "\u{f2b0}" + case flag = "\u{f024}" + case flagCheckered = "\u{f11e}" + case flagO = "\u{f11d}" + case flash = "\u{f0e7}A" + case flask = "\u{f0c3}" + case flickr = "\u{f16e}" + case floppyO = "\u{f0c7}" + case folder = "\u{f07b}" + case folderO = "\u{f114}" + case folderOpen = "\u{f07c}" + case folderOpenO = "\u{f115}" + case font = "\u{f031}" + case fontAwesome = "\u{f2b4}" + case fonticons = "\u{f280}" + case fortAwesome = "\u{f286}" + case forumbee = "\u{f211}" + case forward = "\u{f04e}" + case foursquare = "\u{f180}" + case freeCodeCamp = "\u{f2c5}" + case frownO = "\u{f119}" + case futbolO = "\u{f1e3}" + case gamepad = "\u{f11b}" + case gavel = "\u{f0e3}" + case gbp = "\u{f154}" + case ge = "\u{f1d1}A" + case gear = "\u{f013}A" + case gears = "\u{f085}A" + case genderless = "\u{f22d}" + case getPocket = "\u{f265}" + case gg = "\u{f260}" + case ggCircle = "\u{f261}" + case gift = "\u{f06b}" + case git = "\u{f1d3}" + case gitSquare = "\u{f1d2}" + case github = "\u{f09b}" + case githubAlt = "\u{f113}" + case githubSquare = "\u{f092}" + case gitlab = "\u{f296}" + case gittip = "\u{f184}A" + case glass = "\u{f000}" + case glide = "\u{f2a5}" + case glideG = "\u{f2a6}" + case globe = "\u{f0ac}" + case google = "\u{f1a0}" + case googlePlus = "\u{f0d5}" + case googlePlusCircle = "\u{f2b3}A" + case googlePlusOfficial = "\u{f2b3}" + case googlePlusSquare = "\u{f0d4}" + case googleWallet = "\u{f1ee}" + case graduationCap = "\u{f19d}" + case gratipay = "\u{f184}" + case grav = "\u{f2d6}" + case group = "\u{f0c0}A" + case hSquare = "\u{f0fd}" + case hackerNews = "\u{f1d4}" + case handGrabO = "\u{f255}A" + case handLizardO = "\u{f258}" + case handODown = "\u{f0a7}" + case handOLeft = "\u{f0a5}" + case handORight = "\u{f0a4}" + case handOUp = "\u{f0a6}" + case handPaperO = "\u{f256}" + case handPeaceO = "\u{f25b}" + case handPointerO = "\u{f25a}" + case handRockO = "\u{f255}" + case handScissorsO = "\u{f257}" + case handShakeO = "\u{f2b5}" + case handSpockO = "\u{f259}" + case handStopO = "\u{f256}A" + case hardOfHearing = "\u{f2a4}B" + case hashtag = "\u{f292}" + case hddO = "\u{f0a0}" + case header = "\u{f1dc}" + case headphones = "\u{f025}" + case heart = "\u{f004}" + case heartO = "\u{f08a}" + case heartbeat = "\u{f21e}" + case history = "\u{f1da}" + case home = "\u{f015}" + case hospitalO = "\u{f0f8}" + case hotel = "\u{f236}A" + case hourglass = "\u{f254}" + case hourglass1 = "\u{f251}A" + case hourglass2 = "\u{f252}A" + case hourglass3 = "\u{f253}A" + case hourglassEnd = "\u{f253}" + case hourglassHalf = "\u{f252}" + case hourglassO = "\u{f250}" + case hourglassStart = "\u{f251}" + case houzz = "\u{f27c}" + case html5 = "\u{f13b}" + case iCursor = "\u{f246}" + case idBadge = "\u{f2c1}" + case idCard = "\u{f2c2}" + case idCardO = "\u{f2c3}" + case ils = "\u{f20b}" + case image = "\u{f03e}A" + case imdb = "\u{f2d8}" + case inbox = "\u{f01c}" + case indent = "\u{f03c}" + case industry = "\u{f275}" + case info = "\u{f129}" + case infoCircle = "\u{f05a}" + case inr = "\u{f156}" + case instagram = "\u{f16d}" + case institution = "\u{f19c}B" + case internetExplorer = "\u{f26b}" + case intersex = "\u{f224}A" + case ioxhost = "\u{f208}" + case italic = "\u{f033}" + case joomla = "\u{f1aa}" + case jpy = "\u{f157}" + case jsfiddle = "\u{f1cc}" + case key = "\u{f084}" + case keyboardO = "\u{f11c}" + case krw = "\u{f159}" + case language = "\u{f1ab}" + case laptop = "\u{f109}" + case lastFM = "\u{f202}" + case lastFMSquare = "\u{f203}" + case leaf = "\u{f06c}" + case leanpub = "\u{f212}" + case legal = "\u{f0e3}A" + case lemonO = "\u{f094}" + case levelDown = "\u{f149}" + case levelUp = "\u{f148}" + case lifeBouy = "\u{f1cd}A" + case lifeBuoy = "\u{f1cd}B" + case lifeRing = "\u{f1cd}" + case lifeSaver = "\u{f1cd}C" + case lightbulbO = "\u{f0eb}" + case lineChart = "\u{f201}" + case link = "\u{f0c1}" + case linkedIn = "\u{f0e1}" + case linkedInSquare = "\u{f08c}" + case linode = "\u{f2b8}" + case linux = "\u{f17c}" + case list = "\u{f03a}" + case listAlt = "\u{f022}" + case listOL = "\u{f0cb}" + case listUL = "\u{f0ca}" + case locationArrow = "\u{f124}" + case lock = "\u{f023}" + case longArrowDown = "\u{f175}" + case longArrowLeft = "\u{f177}" + case longArrowRight = "\u{f178}" + case longArrowUp = "\u{f176}" + case lowVision = "\u{f2a8}" + case magic = "\u{f0d0}" + case magnet = "\u{f076}" + case mailForward = "\u{f064}A" + case mailReply = "\u{f112}A" + case mailReplyAll = "\u{f122}A" + case male = "\u{f183}" + case map = "\u{f279}" + case mapMarker = "\u{f041}" + case mapO = "\u{f278}" + case mapPin = "\u{f276}" + case mapSigns = "\u{f277}" + case mars = "\u{f222}" + case marsDouble = "\u{f227}" + case marsStroke = "\u{f229}" + case marsStrokeH = "\u{f22b}" + case marsStrokeV = "\u{f22a}" + case maxcdn = "\u{f136}" + case meanpath = "\u{f20c}" + case medium = "\u{f23a}" + case medkit = "\u{f0fa}" + case meetup = "\u{f2e0}" + case mehO = "\u{f11a}" + case mercury = "\u{f223}" + case microchip = "\u{f2db}" + case microphone = "\u{f130}" + case microphoneSlash = "\u{f131}" + case minus = "\u{f068}" + case minusCircle = "\u{f056}" + case minusSquare = "\u{f146}" + case minusSquareO = "\u{f147}" + case mixcloud = "\u{f289}" + case mobile = "\u{f10b}" + case mobilePhone = "\u{f10b}A" + case modx = "\u{f285}" + case money = "\u{f0d6}" + case moonO = "\u{f186}" + case mortarBoard = "\u{f19d}A" + case motorcycle = "\u{f21c}" + case mousePointer = "\u{f245}" + case music = "\u{f001}" + case navicon = "\u{f0c9}A" + case neuter = "\u{f22c}" + case newspaperO = "\u{f1ea}" + case objectGroup = "\u{f247}" + case objectUngroup = "\u{f248}" + case odnoklassniki = "\u{f263}" + case odnoklassnikiSquare = "\u{f264}" + case openCart = "\u{f23d}" + case openID = "\u{f19b}" + case opera = "\u{f26a}" + case optinMonster = "\u{f23c}" + case outdent = "\u{f03b}" + case pagelines = "\u{f18c}" + case paintBrush = "\u{f1fc}" + case paperPlane = "\u{f1d8}" + case paperPlaneO = "\u{f1d9}" + case paperclip = "\u{f0c6}" + case paragraph = "\u{f1dd}" + case paste = "\u{f0ea}A" + case pause = "\u{f04c}" + case pauseCircle = "\u{f28b}" + case pauseCircleO = "\u{f28c}" + case paw = "\u{f1b0}" + case paypal = "\u{f1ed}" + case pencil = "\u{f040}" + case pencilSquare = "\u{f14b}" + case pencilSquareO = "\u{f044}" + case percent = "\u{f295}" + case phone = "\u{f095}" + case phoneSquare = "\u{f098}" + case photo = "\u{f03e}B" + case pictureO = "\u{f03e}" + case pieChart = "\u{f200}" + case piedPiper = "\u{f2ae}" + case piedPiperAlt = "\u{f1a8}" + case piedPiperPp = "\u{f1a7}" + case pinterest = "\u{f0d2}" + case pinterestP = "\u{f231}" + case pinterestSquare = "\u{f0d3}" + case plane = "\u{f072}" + case play = "\u{f04b}" + case playCircle = "\u{f144}" + case playCircleO = "\u{f01d}" + case plug = "\u{f1e6}" + case plus = "\u{f067}" + case plusCircle = "\u{f055}" + case plusSquare = "\u{f0fe}" + case plusSquareO = "\u{f196}" + case podcast = "\u{f2ce}" + case powerOff = "\u{f011}" + case print = "\u{f02f}" + case productHunt = "\u{f288}" + case puzzlePiece = "\u{f12e}" + case qq = "\u{f1d6}" + case qrcode = "\u{f029}" + case quora = "\u{f2c4}" + case question = "\u{f128}" + case questionCircle = "\u{f059}" + case questionCircleO = "\u{f29c}" + case quoteLeft = "\u{f10d}" + case quoteRight = "\u{f10e}" + case ra = "\u{f1d0}A" + case random = "\u{f074}" + case ravelry = "\u{f2d9}" + case rebel = "\u{f1d0}" + case recycle = "\u{f1b8}" + case reddit = "\u{f1a1}" + case redditAlien = "\u{f281}" + case redditSquare = "\u{f1a2}" + case refresh = "\u{f021}" + case registered = "\u{f25d}" + case remove = "\u{f00d}B" + case renren = "\u{f18b}" + case reorder = "\u{f0c9}B" + case `repeat` = "\u{f01e}" + case reply = "\u{f112}" + case replyAll = "\u{f122}" + case resistance = "\u{f1d0}B" + case retweet = "\u{f079}" + case rmb = "\u{f157}B" + case road = "\u{f018}" + case rocket = "\u{f135}" + case rotateLeft = "\u{f0e2}A" + case rotateRight = "\u{f01e}A" + case rouble = "\u{f158}A" + case rss = "\u{f09e}" + case rssSquare = "\u{f143}" + case rub = "\u{f158}" + case ruble = "\u{f158}B" + case rupee = "\u{f156}A" + case safari = "\u{f267}" + case save = "\u{f0c7}A" + case scissors = "\u{f0c4}" + case scribd = "\u{f28a}" + case search = "\u{f002}" + case searchMinus = "\u{f010}" + case searchPlus = "\u{f00e}" + case sellsy = "\u{f213}" + case send = "\u{f1d8}A" + case sendO = "\u{f1d9}A" + case server = "\u{f233}" + case share = "\u{f064}" + case shareAlt = "\u{f1e0}" + case shareAltSquare = "\u{f1e1}" + case shareSquare = "\u{f14d}" + case shareSquareO = "\u{f045}" + case shekel = "\u{f20b}A" + case sheqel = "\u{f20b}B" + case shield = "\u{f132}" + case ship = "\u{f21a}" + case shirtsinbulk = "\u{f214}" + case shoppingBag = "\u{f290}" + case shoppingBasket = "\u{f291}" + case shoppingCart = "\u{f07a}" + case shower = "\u{f2cc}" + case signIn = "\u{f090}" + case signLanguage = "\u{f2a7}" + case signOut = "\u{f08b}" + case signal = "\u{f012}" + case signing = "\u{f2a7}A" + case simplybuilt = "\u{f215}" + case sitemap = "\u{f0e8}" + case skyatlas = "\u{f216}" + case skype = "\u{f17e}" + case slack = "\u{f198}" + case sliders = "\u{f1de}" + case slideshare = "\u{f1e7}" + case smileO = "\u{f118}" + case snapchat = "\u{f2ab}" + case snapchatGhost = "\u{f2ac}" + case snapchatSquare = "\u{f2ad}" + case snowflakeO = "\u{f2dc}" + case soccerBallO = "\u{f1e3}A" + case sort = "\u{f0dc}" + case sortAlphaAsc = "\u{f15d}" + case sortAlphaDesc = "\u{f15e}" + case sortAmountAsc = "\u{f160}" + case sortAmountDesc = "\u{f161}" + case sortAsc = "\u{f0de}" + case sortDesc = "\u{f0dd}" + case sortDown = "\u{f0dd}A" + case sortNumericAsc = "\u{f162}" + case sortNumericDesc = "\u{f163}" + case sortUp = "\u{f0de}A" + case soundCloud = "\u{f1be}" + case spaceShuttle = "\u{f197}" + case spinner = "\u{f110}" + case spoon = "\u{f1b1}" + case spotify = "\u{f1bc}" + case square = "\u{f0c8}" + case squareO = "\u{f096}" + case stackExchange = "\u{f18d}" + case stackOverflow = "\u{f16c}" + case star = "\u{f005}" + case starHalf = "\u{f089}" + case starHalfEmpty = "\u{f123}A" + case starHalfFull = "\u{f123}B" + case starHalfO = "\u{f123}" + case starO = "\u{f006}" + case steam = "\u{f1b6}" + case steamSquare = "\u{f1b7}" + case stepBackward = "\u{f048}" + case stepForward = "\u{f051}" + case stethoscope = "\u{f0f1}" + case stickyNote = "\u{f249}" + case stickyNoteO = "\u{f24a}" + case stop = "\u{f04d}" + case stopCircle = "\u{f28d}" + case stopCircleO = "\u{f28e}" + case streetView = "\u{f21d}" + case strikethrough = "\u{f0cc}" + case stumbleUpon = "\u{f1a4}" + case stumbleUponCircle = "\u{f1a3}" + case `subscript` = "\u{f12c}" + case subway = "\u{f239}" + case suitcase = "\u{f0f2}" + case sunO = "\u{f185}" + case superscript = "\u{f12b}" + case superpowers = "\u{f2dd}" + case support = "\u{f1cd}D" + case table = "\u{f0ce}" + case tablet = "\u{f10a}" + case tachometer = "\u{f0e4}" + case tag = "\u{f02b}" + case tags = "\u{f02c}" + case tasks = "\u{f0ae}" + case taxi = "\u{f1ba}" + case telegram = "\u{f2c6}" + case television = "\u{f26c}" + case tencentWeibo = "\u{f1d5}" + case terminal = "\u{f120}" + case textHeight = "\u{f034}" + case textWidth = "\u{f035}" + case th = "\u{f00a}" + case thLarge = "\u{f009}" + case thList = "\u{f00b}" + case themeisle = "\u{f2b2}" + case thermometerEmpty = "\u{f2cb}" + case thermometerFull = "\u{f2c7}" + case thermometerHalf = "\u{f2c9}" + case thermometerQuarter = "\u{f2ca}" + case thermometerThreeQuarters = "\u{f2c8}" + case thumbTack = "\u{f08d}" + case thumbsDown = "\u{f165}" + case thumbsODown = "\u{f088}" + case thumbsOUp = "\u{f087}" + case thumbsUp = "\u{f164}" + case ticket = "\u{f145}" + case times = "\u{f00d}" + case timesCircle = "\u{f057}" + case timesCircleO = "\u{f05c}" + case tint = "\u{f043}" + case toggleDown = "\u{f150}A" + case toggleLeft = "\u{f191}A" + case toggleOff = "\u{f204}" + case toggleOn = "\u{f205}" + case toggleRight = "\u{f152}A" + case toggleUp = "\u{f151}A" + case trademark = "\u{f25c}" + case train = "\u{f238}" + case transgender = "\u{f224}" + case transgenderAlt = "\u{f225}" + case trash = "\u{f1f8}" + case trashO = "\u{f014}" + case tree = "\u{f1bb}" + case trello = "\u{f181}" + case tripAdvisor = "\u{f262}" + case trophy = "\u{f091}" + case truck = "\u{f0d1}" + case `try` = "\u{f195}" + case tty = "\u{f1e4}" + case tumblr = "\u{f173}" + case tumblrSquare = "\u{f174}" + case turkishLira = "\u{f195}A" + case tv = "\u{f26c}A" + case twitch = "\u{f1e8}" + case twitter = "\u{f099}" + case twitterSquare = "\u{f081}" + case umbrella = "\u{f0e9}" + case underline = "\u{f0cd}" + case undo = "\u{f0e2}" + case universalAccess = "\u{f29a}" + case university = "\u{f19c}" + case unlink = "\u{f127}A" + case unlock = "\u{f09c}" + case unlockAlt = "\u{f13e}" + case unsorted = "\u{f0dc}A" + case upload = "\u{f093}" + case usb = "\u{f287}" + case usd = "\u{f155}" + case user = "\u{f007}" + case userO = "\u{f2c0}" + case userCircle = "\u{f2bd}" + case userCircleO = "\u{f2be}" + case userMd = "\u{f0f0}" + case userPlus = "\u{f234}" + case userSecret = "\u{f21b}" + case userTimes = "\u{f235}" + case users = "\u{f0c0}" + case venus = "\u{f221}" + case venusDouble = "\u{f226}" + case venusMars = "\u{f228}" + case viacoin = "\u{f237}" + case viadeo = "\u{f2a9}" + case viadeoSquare = "\u{f2aa}" + case videoCamera = "\u{f03d}" + case vimeo = "\u{f27d}" + case vimeoSquare = "\u{f194}" + case vine = "\u{f1ca}" + case vk = "\u{f189}" + case volumeControlPhone = "\u{f2a0}" + case volumeDown = "\u{f027}" + case volumeOff = "\u{f026}" + case volumeUp = "\u{f028}" + case warning = "\u{f071}A" + case wechat = "\u{f1d7}A" + case weibo = "\u{f18a}" + case weixin = "\u{f1d7}" + case whatsapp = "\u{f232}" + case wheelchair = "\u{f193}" + case wheelchairAlt = "\u{f29b}" + case wifi = "\u{f1eb}" + case wikipediaW = "\u{f266}" + case windowClose = "\u{f2d3}" + case windowCloseO = "\u{f2d4}" + case windowMaximize = "\u{f2d0}" + case windowMinimize = "\u{f2d1}" + case windowRestore = "\u{f2d2}" + case windows = "\u{f17a}" + case won = "\u{f159}A" + case wordpress = "\u{f19a}" + case wpbeginner = "\u{f297}" + case wpexplorer = "\u{f2de}" + case wpforms = "\u{f298}" + case wrench = "\u{f0ad}" + case xing = "\u{f168}" + case xingSquare = "\u{f169}" + case yCombinator = "\u{f23b}" + case yCombinatorSquare = "\u{f1d4}A" + case yahoo = "\u{f19e}" + case yc = "\u{f23b}A" + case ycSquare = "\u{f1d4}B" + case yelp = "\u{f1e9}" + case yen = "\u{f157}C" + case yoast = "\u{f2b1}" + case youTube = "\u{f167}" + case youTubePlay = "\u{f16a}" + case youTubeSquare = "\u{f166}" + + /// Get a FontAwesome string from the given CSS icon code. Icon code can be found here: http://fontawesome.io/icons/ + /// + /// - parameter code: The preferred icon name. + /// - returns: FontAwesome icon. + public static func fromCode(_ code: String) -> FontAwesome? { + guard let raw = FontAwesomeIcons[code], let icon = FontAwesome(rawValue: raw) else { + return nil + } + return icon + } +} + +/// An array of FontAwesome icon codes. +// swiftlint:disable identifier_name +public let FontAwesomeIcons: [String : String] = [ + "fa-500px": "\u{f26e}", + "fa-adjust": "\u{f042}", + "fa-adn": "\u{f170}", + "fa-address-book": "\u{f2b9}", + "fa-address-book-o": "\u{f2ba}", + "fa-address-card": "\u{f2bb}", + "fa-address-card-o": "\u{f2bc}", + "fa-align-center": "\u{f037}", + "fa-align-justify": "\u{f039}", + "fa-align-left": "\u{f036}", + "fa-align-right": "\u{f038}", + "fa-amazon": "\u{f270}", + "fa-ambulance": "\u{f0f9}", + "fa-american-sign-language-interpreting": "\u{f2a3}", + "fa-anchor": "\u{f13d}", + "fa-android": "\u{f17b}", + "fa-angellist": "\u{f209}", + "fa-angle-double-down": "\u{f103}", + "fa-angle-double-left": "\u{f100}", + "fa-angle-double-right": "\u{f101}", + "fa-angle-double-up": "\u{f102}", + "fa-angle-down": "\u{f107}", + "fa-angle-left": "\u{f104}", + "fa-angle-right": "\u{f105}", + "fa-angle-up": "\u{f106}", + "fa-apple": "\u{f179}", + "fa-archive": "\u{f187}", + "fa-area-chart": "\u{f1fe}", + "fa-arrow-circle-down": "\u{f0ab}", + "fa-arrow-circle-left": "\u{f0a8}", + "fa-arrow-circle-o-down": "\u{f01a}", + "fa-arrow-circle-o-left": "\u{f190}", + "fa-arrow-circle-o-right": "\u{f18e}", + "fa-arrow-circle-o-up": "\u{f01b}", + "fa-arrow-circle-right": "\u{f0a9}", + "fa-arrow-circle-up": "\u{f0aa}", + "fa-arrow-down": "\u{f063}", + "fa-arrow-left": "\u{f060}", + "fa-arrow-right": "\u{f061}", + "fa-arrow-up": "\u{f062}", + "fa-arrows": "\u{f047}", + "fa-arrows-alt": "\u{f0b2}", + "fa-arrows-h": "\u{f07e}", + "fa-arrows-v": "\u{f07d}", + "fa-asl-interpreting": "\u{f2a3}", + "fa-assistive-listening-systems": "\u{f2a2}", + "fa-asterisk": "\u{f069}", + "fa-at": "\u{f1fa}", + "fa-audio-description": "\u{f29e}", + "fa-automobile": "\u{f1b9}", + "fa-backward": "\u{f04a}", + "fa-balance-scale": "\u{f24e}", + "fa-ban": "\u{f05e}", + "fa-bandcamp": "\u{f2d5}", + "fa-bank": "\u{f19c}", + "fa-bar-chart": "\u{f080}", + "fa-bar-chart-o": "\u{f080}", + "fa-barcode": "\u{f02a}", + "fa-bars": "\u{f0c9}", + "fa-bath": "\u{f2cd}", + "fa-battery-0": "\u{f244}", + "fa-battery-1": "\u{f243}", + "fa-battery-2": "\u{f242}", + "fa-battery-3": "\u{f241}", + "fa-battery-4": "\u{f240}", + "fa-battery-empty": "\u{f244}", + "fa-battery-full": "\u{f240}", + "fa-battery-half": "\u{f242}", + "fa-battery-quarter": "\u{f243}", + "fa-battery-three-quarters": "\u{f241}", + "fa-bed": "\u{f236}", + "fa-beer": "\u{f0fc}", + "fa-behance": "\u{f1b4}", + "fa-behance-square": "\u{f1b5}", + "fa-bell": "\u{f0f3}", + "fa-bell-o": "\u{f0a2}", + "fa-bell-slash": "\u{f1f6}", + "fa-bell-slash-o": "\u{f1f7}", + "fa-bicycle": "\u{f206}", + "fa-binoculars": "\u{f1e5}", + "fa-birthday-cake": "\u{f1fd}", + "fa-bitbucket": "\u{f171}", + "fa-bitbucket-square": "\u{f172}", + "fa-bitcoin": "\u{f15a}", + "fa-black-tie": "\u{f27e}", + "fa-blind": "\u{f29d}", + "fa-bluetooth": "\u{f293}", + "fa-bluetooth-b": "\u{f294}", + "fa-bold": "\u{f032}", + "fa-bolt": "\u{f0e7}", + "fa-bomb": "\u{f1e2}", + "fa-book": "\u{f02d}", + "fa-bookmark": "\u{f02e}", + "fa-bookmark-o": "\u{f097}", + "fa-braille": "\u{f2a1}", + "fa-briefcase": "\u{f0b1}", + "fa-btc": "\u{f15a}", + "fa-bug": "\u{f188}", + "fa-building": "\u{f1ad}", + "fa-building-o": "\u{f0f7}", + "fa-bullhorn": "\u{f0a1}", + "fa-bullseye": "\u{f140}", + "fa-bus": "\u{f207}", + "fa-buysellads": "\u{f20d}", + "fa-cab": "\u{f1ba}", + "fa-calculator": "\u{f1ec}", + "fa-calendar": "\u{f073}", + "fa-calendar-check-o": "\u{f274}", + "fa-calendar-minus-o": "\u{f272}", + "fa-calendar-o": "\u{f133}", + "fa-calendar-plus-o": "\u{f271}", + "fa-calendar-times-o": "\u{f273}", + "fa-camera": "\u{f030}", + "fa-camera-retro": "\u{f083}", + "fa-car": "\u{f1b9}", + "fa-caret-down": "\u{f0d7}", + "fa-caret-left": "\u{f0d9}", + "fa-caret-right": "\u{f0da}", + "fa-caret-square-o-down": "\u{f150}", + "fa-caret-square-o-left": "\u{f191}", + "fa-caret-square-o-right": "\u{f152}", + "fa-caret-square-o-up": "\u{f151}", + "fa-caret-up": "\u{f0d8}", + "fa-cart-arrow-down": "\u{f218}", + "fa-cart-plus": "\u{f217}", + "fa-cc": "\u{f20a}", + "fa-cc-amex": "\u{f1f3}", + "fa-cc-diners-club": "\u{f24c}", + "fa-cc-discover": "\u{f1f2}", + "fa-cc-jcb": "\u{f24b}", + "fa-cc-mastercard": "\u{f1f1}", + "fa-cc-paypal": "\u{f1f4}", + "fa-cc-stripe": "\u{f1f5}", + "fa-cc-visa": "\u{f1f0}", + "fa-certificate": "\u{f0a3}", + "fa-chain": "\u{f0c1}", + "fa-chain-broken": "\u{f127}", + "fa-check": "\u{f00c}", + "fa-check-circle": "\u{f058}", + "fa-check-circle-o": "\u{f05d}", + "fa-check-square": "\u{f14a}", + "fa-check-square-o": "\u{f046}", + "fa-chevron-circle-down": "\u{f13a}", + "fa-chevron-circle-left": "\u{f137}", + "fa-chevron-circle-right": "\u{f138}", + "fa-chevron-circle-up": "\u{f139}", + "fa-chevron-down": "\u{f078}", + "fa-chevron-left": "\u{f053}", + "fa-chevron-right": "\u{f054}", + "fa-chevron-up": "\u{f077}", + "fa-child": "\u{f1ae}", + "fa-chrome": "\u{f268}", + "fa-circle": "\u{f111}", + "fa-circle-o": "\u{f10c}", + "fa-circle-o-notch": "\u{f1ce}", + "fa-circle-thin": "\u{f1db}", + "fa-clipboard": "\u{f0ea}", + "fa-clock-o": "\u{f017}", + "fa-clone": "\u{f24d}", + "fa-close": "\u{f00d}", + "fa-cloud": "\u{f0c2}", + "fa-cloud-download": "\u{f0ed}", + "fa-cloud-upload": "\u{f0ee}", + "fa-cny": "\u{f157}", + "fa-code": "\u{f121}", + "fa-code-fork": "\u{f126}", + "fa-codepen": "\u{f1cb}", + "fa-codiepie": "\u{f284}", + "fa-coffee": "\u{f0f4}", + "fa-cog": "\u{f013}", + "fa-cogs": "\u{f085}", + "fa-columns": "\u{f0db}", + "fa-comment": "\u{f075}", + "fa-comment-o": "\u{f0e5}", + "fa-commenting": "\u{f27a}", + "fa-commenting-o": "\u{f27b}", + "fa-comments": "\u{f086}", + "fa-comments-o": "\u{f0e6}", + "fa-compass": "\u{f14e}", + "fa-compress": "\u{f066}", + "fa-connectdevelop": "\u{f20e}", + "fa-contao": "\u{f26d}", + "fa-copy": "\u{f0c5}", + "fa-copyright": "\u{f1f9}", + "fa-creative-commons": "\u{f25e}", + "fa-credit-card": "\u{f09d}", + "fa-credit-card-alt": "\u{f283}", + "fa-crop": "\u{f125}", + "fa-crosshairs": "\u{f05b}", + "fa-css3": "\u{f13c}", + "fa-cube": "\u{f1b2}", + "fa-cubes": "\u{f1b3}", + "fa-cut": "\u{f0c4}", + "fa-cutlery": "\u{f0f5}", + "fa-dashboard": "\u{f0e4}", + "fa-dashcube": "\u{f210}", + "fa-database": "\u{f1c0}", + "fa-deaf": "\u{f2a4}", + "fa-deafness": "\u{f2a4}", + "fa-dedent": "\u{f03b}", + "fa-delicious": "\u{f1a5}", + "fa-desktop": "\u{f108}", + "fa-deviantart": "\u{f1bd}", + "fa-diamond": "\u{f219}", + "fa-digg": "\u{f1a6}", + "fa-dollar": "\u{f155}", + "fa-dot-circle-o": "\u{f192}", + "fa-download": "\u{f019}", + "fa-dribbble": "\u{f17d}", + "fa-dropbox": "\u{f16b}", + "fa-drupal": "\u{f1a9}", + "fa-edge": "\u{f282}", + "fa-edit": "\u{f044}", + "fa-eercast": "\u{f2da}", + "fa-eject": "\u{f052}", + "fa-ellipsis-h": "\u{f141}", + "fa-ellipsis-v": "\u{f142}", + "fa-empire": "\u{f1d1}", + "fa-envelope": "\u{f0e0}", + "fa-envelope-o": "\u{f003}", + "fa-envelope-square": "\u{f199}", + "fa-envelope-open": "\u{f2b6}", + "fa-envelope-open-o": "\u{f2b7}", + "fa-envira": "\u{f299}", + "fa-eraser": "\u{f12d}", + "fa-etsy": "\u{f2d7}", + "fa-eur": "\u{f153}", + "fa-euro": "\u{f153}", + "fa-exchange": "\u{f0ec}", + "fa-exclamation": "\u{f12a}", + "fa-exclamation-circle": "\u{f06a}", + "fa-exclamation-triangle": "\u{f071}", + "fa-expand": "\u{f065}", + "fa-expeditedssl": "\u{f23e}", + "fa-external-link": "\u{f08e}", + "fa-external-link-square": "\u{f14c}", + "fa-eye": "\u{f06e}", + "fa-eye-slash": "\u{f070}", + "fa-eyedropper": "\u{f1fb}", + "fa-fa": "\u{f2b4}", + "fa-facebook": "\u{f09a}", + "fa-facebook-f": "\u{f09a}", + "fa-facebook-official": "\u{f230}", + "fa-facebook-square": "\u{f082}", + "fa-fast-backward": "\u{f049}", + "fa-fast-forward": "\u{f050}", + "fa-fax": "\u{f1ac}", + "fa-feed": "\u{f09e}", + "fa-female": "\u{f182}", + "fa-fighter-jet": "\u{f0fb}", + "fa-file": "\u{f15b}", + "fa-file-archive-o": "\u{f1c6}", + "fa-file-audio-o": "\u{f1c7}", + "fa-file-code-o": "\u{f1c9}", + "fa-file-excel-o": "\u{f1c3}", + "fa-file-image-o": "\u{f1c5}", + "fa-file-movie-o": "\u{f1c8}", + "fa-file-o": "\u{f016}", + "fa-file-pdf-o": "\u{f1c1}", + "fa-file-photo-o": "\u{f1c5}", + "fa-file-picture-o": "\u{f1c5}", + "fa-file-powerpoint-o": "\u{f1c4}", + "fa-file-sound-o": "\u{f1c7}", + "fa-file-text": "\u{f15c}", + "fa-file-text-o": "\u{f0f6}", + "fa-file-video-o": "\u{f1c8}", + "fa-file-word-o": "\u{f1c2}", + "fa-file-zip-o": "\u{f1c6}", + "fa-files-o": "\u{f0c5}", + "fa-film": "\u{f008}", + "fa-filter": "\u{f0b0}", + "fa-fire": "\u{f06d}", + "fa-fire-extinguisher": "\u{f134}", + "fa-firefox": "\u{f269}", + "fa-first-order": "\u{f2b0}", + "fa-flag": "\u{f024}", + "fa-flag-checkered": "\u{f11e}", + "fa-flag-o": "\u{f11d}", + "fa-flash": "\u{f0e7}", + "fa-flask": "\u{f0c3}", + "fa-flickr": "\u{f16e}", + "fa-floppy-o": "\u{f0c7}", + "fa-folder": "\u{f07b}", + "fa-folder-o": "\u{f114}", + "fa-folder-open": "\u{f07c}", + "fa-folder-open-o": "\u{f115}", + "fa-font": "\u{f031}", + "fa-font-awesome": "\u{f2b4}", + "fa-fonticons": "\u{f280}", + "fa-fort-awesome": "\u{f286}", + "fa-forumbee": "\u{f211}", + "fa-forward": "\u{f04e}", + "fa-foursquare": "\u{f180}", + "fa-free-code-camp": "\u{f2c5}", + "fa-frown-o": "\u{f119}", + "fa-futbol-o": "\u{f1e3}", + "fa-gamepad": "\u{f11b}", + "fa-gavel": "\u{f0e3}", + "fa-gbp": "\u{f154}", + "fa-ge": "\u{f1d1}", + "fa-gear": "\u{f013}", + "fa-gears": "\u{f085}", + "fa-genderless": "\u{f22d}", + "fa-get-pocket": "\u{f265}", + "fa-gg": "\u{f260}", + "fa-gg-circle": "\u{f261}", + "fa-gift": "\u{f06b}", + "fa-git": "\u{f1d3}", + "fa-git-square": "\u{f1d2}", + "fa-github": "\u{f09b}", + "fa-github-alt": "\u{f113}", + "fa-github-square": "\u{f092}", + "fa-gitlab": "\u{f296}", + "fa-gittip": "\u{f184}", + "fa-glass": "\u{f000}", + "fa-glide": "\u{f2a5}", + "fa-glide-g": "\u{f2a6}", + "fa-globe": "\u{f0ac}", + "fa-google": "\u{f1a0}", + "fa-google-plus": "\u{f0d5}", + "fa-google-plus-circle": "\u{f2b3}", + "fa-google-plus-official": "\u{f2b3}", + "fa-google-plus-square": "\u{f0d4}", + "fa-google-wallet": "\u{f1ee}", + "fa-graduation-cap": "\u{f19d}", + "fa-gratipay": "\u{f184}", + "fa-grav": "\u{f2d6}", + "fa-group": "\u{f0c0}", + "fa-h-square": "\u{f0fd}", + "fa-hacker-news": "\u{f1d4}", + "fa-handshake-o": "\u{f2b5}", + "fa-hand-grab-o": "\u{f255}", + "fa-hand-lizard-o": "\u{f258}", + "fa-hand-o-down": "\u{f0a7}", + "fa-hand-o-left": "\u{f0a5}", + "fa-hand-o-right": "\u{f0a4}", + "fa-hand-o-up": "\u{f0a6}", + "fa-hand-paper-o": "\u{f256}", + "fa-hand-peace-o": "\u{f25b}", + "fa-hand-pointer-o": "\u{f25a}", + "fa-hand-rock-o": "\u{f255}", + "fa-hand-scissors-o": "\u{f257}", + "fa-hand-spock-o": "\u{f259}", + "fa-hand-stop-o": "\u{f256}", + "fa-hard-of-hearing": "\u{f2a4}", + "fa-hashtag": "\u{f292}", + "fa-hdd-o": "\u{f0a0}", + "fa-header": "\u{f1dc}", + "fa-headphones": "\u{f025}", + "fa-heart": "\u{f004}", + "fa-heart-o": "\u{f08a}", + "fa-heartbeat": "\u{f21e}", + "fa-history": "\u{f1da}", + "fa-home": "\u{f015}", + "fa-hospital-o": "\u{f0f8}", + "fa-hotel": "\u{f236}", + "fa-hourglass": "\u{f254}", + "fa-hourglass-1": "\u{f251}", + "fa-hourglass-2": "\u{f252}", + "fa-hourglass-3": "\u{f253}", + "fa-hourglass-end": "\u{f253}", + "fa-hourglass-half": "\u{f252}", + "fa-hourglass-o": "\u{f250}", + "fa-hourglass-start": "\u{f251}", + "fa-houzz": "\u{f27c}", + "fa-html5": "\u{f13b}", + "fa-i-cursor": "\u{f246}", + "fa-id-badge": "\u{f2c1}", + "fa-id-card": "\u{f2c2}", + "fa-id-card-o": "\u{f2c3}", + "fa-ils": "\u{f20b}", + "fa-image": "\u{f03e}", + "fa-imdb": "\u{f2d8}", + "fa-inbox": "\u{f01c}", + "fa-indent": "\u{f03c}", + "fa-industry": "\u{f275}", + "fa-info": "\u{f129}", + "fa-info-circle": "\u{f05a}", + "fa-inr": "\u{f156}", + "fa-instagram": "\u{f16d}", + "fa-institution": "\u{f19c}", + "fa-internet-explorer": "\u{f26b}", + "fa-intersex": "\u{f224}", + "fa-ioxhost": "\u{f208}", + "fa-italic": "\u{f033}", + "fa-joomla": "\u{f1aa}", + "fa-jpy": "\u{f157}", + "fa-jsfiddle": "\u{f1cc}", + "fa-key": "\u{f084}", + "fa-keyboard-o": "\u{f11c}", + "fa-krw": "\u{f159}", + "fa-language": "\u{f1ab}", + "fa-laptop": "\u{f109}", + "fa-lastfm": "\u{f202}", + "fa-lastfm-square": "\u{f203}", + "fa-leaf": "\u{f06c}", + "fa-leanpub": "\u{f212}", + "fa-legal": "\u{f0e3}", + "fa-lemon-o": "\u{f094}", + "fa-level-down": "\u{f149}", + "fa-level-up": "\u{f148}", + "fa-life-bouy": "\u{f1cd}", + "fa-life-buoy": "\u{f1cd}", + "fa-life-ring": "\u{f1cd}", + "fa-life-saver": "\u{f1cd}", + "fa-lightbulb-o": "\u{f0eb}", + "fa-line-chart": "\u{f201}", + "fa-link": "\u{f0c1}", + "fa-linkedin": "\u{f0e1}", + "fa-linkedin-square": "\u{f08c}", + "fa-linode": "\u{f2b8}", + "fa-linux": "\u{f17c}", + "fa-list": "\u{f03a}", + "fa-list-alt": "\u{f022}", + "fa-list-ol": "\u{f0cb}", + "fa-list-ul": "\u{f0ca}", + "fa-location-arrow": "\u{f124}", + "fa-lock": "\u{f023}", + "fa-long-arrow-down": "\u{f175}", + "fa-long-arrow-left": "\u{f177}", + "fa-long-arrow-right": "\u{f178}", + "fa-long-arrow-up": "\u{f176}", + "fa-low-vision": "\u{f2a8}", + "fa-magic": "\u{f0d0}", + "fa-magnet": "\u{f076}", + "fa-mail-forward": "\u{f064}", + "fa-mail-reply": "\u{f112}", + "fa-mail-reply-all": "\u{f122}", + "fa-male": "\u{f183}", + "fa-map": "\u{f279}", + "fa-map-marker": "\u{f041}", + "fa-map-o": "\u{f278}", + "fa-map-pin": "\u{f276}", + "fa-map-signs": "\u{f277}", + "fa-mars": "\u{f222}", + "fa-mars-double": "\u{f227}", + "fa-mars-stroke": "\u{f229}", + "fa-mars-stroke-h": "\u{f22b}", + "fa-mars-stroke-v": "\u{f22a}", + "fa-maxcdn": "\u{f136}", + "fa-meanpath": "\u{f20c}", + "fa-medium": "\u{f23a}", + "fa-medkit": "\u{f0fa}", + "fa-meetup": "\u{f2e0}", + "fa-meh-o": "\u{f11a}", + "fa-mercury": "\u{f223}", + "fa-microchip": "\u{f2db}", + "fa-microphone": "\u{f130}", + "fa-microphone-slash": "\u{f131}", + "fa-minus": "\u{f068}", + "fa-minus-circle": "\u{f056}", + "fa-minus-square": "\u{f146}", + "fa-minus-square-o": "\u{f147}", + "fa-mixcloud": "\u{f289}", + "fa-mobile": "\u{f10b}", + "fa-mobile-phone": "\u{f10b}", + "fa-modx": "\u{f285}", + "fa-money": "\u{f0d6}", + "fa-moon-o": "\u{f186}", + "fa-mortar-board": "\u{f19d}", + "fa-motorcycle": "\u{f21c}", + "fa-mouse-pointer": "\u{f245}", + "fa-music": "\u{f001}", + "fa-navicon": "\u{f0c9}", + "fa-neuter": "\u{f22c}", + "fa-newspaper-o": "\u{f1ea}", + "fa-object-group": "\u{f247}", + "fa-object-ungroup": "\u{f248}", + "fa-odnoklassniki": "\u{f263}", + "fa-odnoklassniki-square": "\u{f264}", + "fa-opencart": "\u{f23d}", + "fa-openid": "\u{f19b}", + "fa-opera": "\u{f26a}", + "fa-optin-monster": "\u{f23c}", + "fa-outdent": "\u{f03b}", + "fa-pagelines": "\u{f18c}", + "fa-paint-brush": "\u{f1fc}", + "fa-paper-plane": "\u{f1d8}", + "fa-paper-plane-o": "\u{f1d9}", + "fa-paperclip": "\u{f0c6}", + "fa-paragraph": "\u{f1dd}", + "fa-paste": "\u{f0ea}", + "fa-pause": "\u{f04c}", + "fa-pause-circle": "\u{f28b}", + "fa-pause-circle-o": "\u{f28c}", + "fa-paw": "\u{f1b0}", + "fa-paypal": "\u{f1ed}", + "fa-pencil": "\u{f040}", + "fa-pencil-square": "\u{f14b}", + "fa-pencil-square-o": "\u{f044}", + "fa-percent": "\u{f295}", + "fa-phone": "\u{f095}", + "fa-phone-square": "\u{f098}", + "fa-photo": "\u{f03e}", + "fa-picture-o": "\u{f03e}", + "fa-pie-chart": "\u{f200}", + "fa-pied-piper": "\u{f2ae}", + "fa-pied-piper-alt": "\u{f1a8}", + "fa-pied-piper-pp": "\u{f1a7}", + "fa-pinterest": "\u{f0d2}", + "fa-pinterest-p": "\u{f231}", + "fa-pinterest-square": "\u{f0d3}", + "fa-plane": "\u{f072}", + "fa-play": "\u{f04b}", + "fa-play-circle": "\u{f144}", + "fa-play-circle-o": "\u{f01d}", + "fa-plug": "\u{f1e6}", + "fa-plus": "\u{f067}", + "fa-plus-circle": "\u{f055}", + "fa-plus-square": "\u{f0fe}", + "fa-plus-square-o": "\u{f196}", + "fa-podcast": "\u{f2ce}", + "fa-power-off": "\u{f011}", + "fa-print": "\u{f02f}", + "fa-product-hunt": "\u{f288}", + "fa-puzzle-piece": "\u{f12e}", + "fa-qq": "\u{f1d6}", + "fa-qrcode": "\u{f029}", + "fa-question": "\u{f128}", + "fa-question-circle": "\u{f059}", + "fa-question-circle-o": "\u{f29c}", + "fa-quora": "\u{f2c4}", + "fa-quote-left": "\u{f10d}", + "fa-quote-right": "\u{f10e}", + "fa-ra": "\u{f1d0}", + "fa-random": "\u{f074}", + "fa-ravelry": "\u{f2d9}", + "fa-rebel": "\u{f1d0}", + "fa-recycle": "\u{f1b8}", + "fa-reddit": "\u{f1a1}", + "fa-reddit-alien": "\u{f281}", + "fa-reddit-square": "\u{f1a2}", + "fa-refresh": "\u{f021}", + "fa-registered": "\u{f25d}", + "fa-remove": "\u{f00d}", + "fa-renren": "\u{f18b}", + "fa-reorder": "\u{f0c9}", + "fa-repeat": "\u{f01e}", + "fa-reply": "\u{f112}", + "fa-reply-all": "\u{f122}", + "fa-resistance": "\u{f1d0}", + "fa-retweet": "\u{f079}", + "fa-rmb": "\u{f157}", + "fa-road": "\u{f018}", + "fa-rocket": "\u{f135}", + "fa-rotate-left": "\u{f0e2}", + "fa-rotate-right": "\u{f01e}", + "fa-rouble": "\u{f158}", + "fa-rss": "\u{f09e}", + "fa-rss-square": "\u{f143}", + "fa-rub": "\u{f158}", + "fa-ruble": "\u{f158}", + "fa-rupee": "\u{f156}", + "fa-safari": "\u{f267}", + "fa-save": "\u{f0c7}", + "fa-scissors": "\u{f0c4}", + "fa-scribd": "\u{f28a}", + "fa-search": "\u{f002}", + "fa-search-minus": "\u{f010}", + "fa-search-plus": "\u{f00e}", + "fa-sellsy": "\u{f213}", + "fa-send": "\u{f1d8}", + "fa-send-o": "\u{f1d9}", + "fa-server": "\u{f233}", + "fa-share": "\u{f064}", + "fa-share-alt": "\u{f1e0}", + "fa-share-alt-square": "\u{f1e1}", + "fa-share-square": "\u{f14d}", + "fa-share-square-o": "\u{f045}", + "fa-shekel": "\u{f20b}", + "fa-sheqel": "\u{f20b}", + "fa-shield": "\u{f132}", + "fa-ship": "\u{f21a}", + "fa-shirtsinbulk": "\u{f214}", + "fa-shopping-bag": "\u{f290}", + "fa-shopping-basket": "\u{f291}", + "fa-shopping-cart": "\u{f07a}", + "fa-shower": "\u{f2cc}", + "fa-sign-in": "\u{f090}", + "fa-sign-language": "\u{f2a7}", + "fa-sign-out": "\u{f08b}", + "fa-signal": "\u{f012}", + "fa-signing": "\u{f2a7}", + "fa-simplybuilt": "\u{f215}", + "fa-sitemap": "\u{f0e8}", + "fa-skyatlas": "\u{f216}", + "fa-skype": "\u{f17e}", + "fa-slack": "\u{f198}", + "fa-sliders": "\u{f1de}", + "fa-slideshare": "\u{f1e7}", + "fa-smile-o": "\u{f118}", + "fa-snapchat": "\u{f2ab}", + "fa-snapchat-ghost": "\u{f2ac}", + "fa-snapchat-square": "\u{f2ad}", + "fa-snowflake": "\u{f2dc}", + "fa-soccer-ball-o": "\u{f1e3}", + "fa-sort": "\u{f0dc}", + "fa-sort-alpha-asc": "\u{f15d}", + "fa-sort-alpha-desc": "\u{f15e}", + "fa-sort-amount-asc": "\u{f160}", + "fa-sort-amount-desc": "\u{f161}", + "fa-sort-asc": "\u{f0de}", + "fa-sort-desc": "\u{f0dd}", + "fa-sort-down": "\u{f0dd}", + "fa-sort-numeric-asc": "\u{f162}", + "fa-sort-numeric-desc": "\u{f163}", + "fa-sort-up": "\u{f0de}", + "fa-soundcloud": "\u{f1be}", + "fa-space-shuttle": "\u{f197}", + "fa-spinner": "\u{f110}", + "fa-spoon": "\u{f1b1}", + "fa-spotify": "\u{f1bc}", + "fa-square": "\u{f0c8}", + "fa-square-o": "\u{f096}", + "fa-stack-exchange": "\u{f18d}", + "fa-stack-overflow": "\u{f16c}", + "fa-star": "\u{f005}", + "fa-star-half": "\u{f089}", + "fa-star-half-empty": "\u{f123}", + "fa-star-half-full": "\u{f123}", + "fa-star-half-o": "\u{f123}", + "fa-star-o": "\u{f006}", + "fa-steam": "\u{f1b6}", + "fa-steam-square": "\u{f1b7}", + "fa-step-backward": "\u{f048}", + "fa-step-forward": "\u{f051}", + "fa-stethoscope": "\u{f0f1}", + "fa-sticky-note": "\u{f249}", + "fa-sticky-note-o": "\u{f24a}", + "fa-stop": "\u{f04d}", + "fa-stop-circle": "\u{f28d}", + "fa-stop-circle-o": "\u{f28e}", + "fa-street-view": "\u{f21d}", + "fa-strikethrough": "\u{f0cc}", + "fa-stumbleupon": "\u{f1a4}", + "fa-stumbleupon-circle": "\u{f1a3}", + "fa-subscript": "\u{f12c}", + "fa-subway": "\u{f239}", + "fa-suitcase": "\u{f0f2}", + "fa-sun-o": "\u{f185}", + "fa-superpowers": "\u{f2dd}", + "fa-superscript": "\u{f12b}", + "fa-support": "\u{f1cd}", + "fa-table": "\u{f0ce}", + "fa-tablet": "\u{f10a}", + "fa-tachometer": "\u{f0e4}", + "fa-tag": "\u{f02b}", + "fa-tags": "\u{f02c}", + "fa-tasks": "\u{f0ae}", + "fa-taxi": "\u{f1ba}", + "fa-telegram": "\u{f2c6}", + "fa-television": "\u{f26c}", + "fa-tencent-weibo": "\u{f1d5}", + "fa-terminal": "\u{f120}", + "fa-text-height": "\u{f034}", + "fa-text-width": "\u{f035}", + "fa-th": "\u{f00a}", + "fa-th-large": "\u{f009}", + "fa-th-list": "\u{f00b}", + "fa-themeisle": "\u{f2b2}", + "fa-thermometer-empty": "\u{f2cb}", + "fa-fa-thermometer-full": "\u{f2c7}", + "fa-fa-thermometer-half": "\u{f2c9}", + "fa-fa-thermometer-quarter": "\u{f2ca}", + "fa-thermometer-three-quarters": "\u{f2c8}", + "fa-thumb-tack": "\u{f08d}", + "fa-thumbs-down": "\u{f165}", + "fa-thumbs-o-down": "\u{f088}", + "fa-thumbs-o-up": "\u{f087}", + "fa-thumbs-up": "\u{f164}", + "fa-ticket": "\u{f145}", + "fa-times": "\u{f00d}", + "fa-times-circle": "\u{f057}", + "fa-times-circle-o": "\u{f05c}", + "fa-tint": "\u{f043}", + "fa-toggle-down": "\u{f150}", + "fa-toggle-left": "\u{f191}", + "fa-toggle-off": "\u{f204}", + "fa-toggle-on": "\u{f205}", + "fa-toggle-right": "\u{f152}", + "fa-toggle-up": "\u{f151}", + "fa-trademark": "\u{f25c}", + "fa-train": "\u{f238}", + "fa-transgender": "\u{f224}", + "fa-transgender-alt": "\u{f225}", + "fa-trash": "\u{f1f8}", + "fa-trash-o": "\u{f014}", + "fa-tree": "\u{f1bb}", + "fa-trello": "\u{f181}", + "fa-tripadvisor": "\u{f262}", + "fa-trophy": "\u{f091}", + "fa-truck": "\u{f0d1}", + "fa-try": "\u{f195}", + "fa-tty": "\u{f1e4}", + "fa-tumblr": "\u{f173}", + "fa-tumblr-square": "\u{f174}", + "fa-turkish-lira": "\u{f195}", + "fa-tv": "\u{f26c}", + "fa-twitch": "\u{f1e8}", + "fa-twitter": "\u{f099}", + "fa-twitter-square": "\u{f081}", + "fa-umbrella": "\u{f0e9}", + "fa-underline": "\u{f0cd}", + "fa-undo": "\u{f0e2}", + "fa-universal-access": "\u{f29a}", + "fa-university": "\u{f19c}", + "fa-unlink": "\u{f127}", + "fa-unlock": "\u{f09c}", + "fa-unlock-alt": "\u{f13e}", + "fa-unsorted": "\u{f0dc}", + "fa-upload": "\u{f093}", + "fa-usb": "\u{f287}", + "fa-usd": "\u{f155}", + "fa-user": "\u{f007}", + "fa-user-o": "\u{f2c0}", + "fa-user-md": "\u{f0f0}", + "fa-user-plus": "\u{f234}", + "fa-user-secret": "\u{f21b}", + "fa-user-times": "\u{f235}", + "fa-user-circle": "\u{f2bd}", + "fa-user-circle-o": "\u{f2be}", + "fa-users": "\u{f0c0}", + "fa-venus": "\u{f221}", + "fa-venus-double": "\u{f226}", + "fa-venus-mars": "\u{f228}", + "fa-viacoin": "\u{f237}", + "fa-viadeo": "\u{f2a9}", + "fa-viadeo-square": "\u{f2aa}", + "fa-video-camera": "\u{f03d}", + "fa-vimeo": "\u{f27d}", + "fa-vimeo-square": "\u{f194}", + "fa-vine": "\u{f1ca}", + "fa-vk": "\u{f189}", + "fa-volume-control-phone": "\u{f2a0}", + "fa-volume-down": "\u{f027}", + "fa-volume-off": "\u{f026}", + "fa-volume-up": "\u{f028}", + "fa-warning": "\u{f071}", + "fa-wechat": "\u{f1d7}", + "fa-weibo": "\u{f18a}", + "fa-weixin": "\u{f1d7}", + "fa-whatsapp": "\u{f232}", + "fa-wheelchair": "\u{f193}", + "fa-wheelchair-alt": "\u{f29b}", + "fa-wifi": "\u{f1eb}", + "fa-wikipedia-w": "\u{f266}", + "fa-window-close": "\u{f2d3}", + "fa-window-close-o": "\u{f2d4}", + "fa-window-maximize": "\u{f2d0}", + "fa-window-minimize": "\u{f2d1}", + "fa-window-restore": "\u{f2d2}", + "fa-windows": "\u{f17a}", + "fa-won": "\u{f159}", + "fa-wordpress": "\u{f19a}", + "fa-wpbeginner": "\u{f297}", + "fa-wpexplorer": "\u{f2de}", + "fa-wpforms": "\u{f298}", + "fa-wrench": "\u{f0ad}", + "fa-xing": "\u{f168}", + "fa-xing-square": "\u{f169}", + "fa-y-combinator": "\u{f23b}", + "fa-y-combinator-square": "\u{f1d4}", + "fa-yahoo": "\u{f19e}", + "fa-yc": "\u{f23b}", + "fa-yc-square": "\u{f1d4}", + "fa-yelp": "\u{f1e9}", + "fa-yen": "\u{f157}", + "fa-yoast": "\u{f2b1}", + "fa-youtube": "\u{f167}", + "fa-youtube-play": "\u{f16a}", + "fa-youtube-square": "\u{f166}" +] diff --git a/client/Pods/FontAwesome.swift/FontAwesome/FontAwesome.otf b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesome.otf new file mode 100644 index 0000000000000000000000000000000000000000..401ec0f36e4f73b8efa40bd6f604fe80d286db70 GIT binary patch literal 134808 zcmbTed0Z368#p`*x!BDCB%zS7iCT}g-at@1S{090>rJgUas+}vf=M{#z9E1d;RZp( zTk)*csx3XW+FN?rySCrfT6=x96PQ4M&nDV$`+NU*-_Pr^*_qjA=9!u2oM&cT84zXq}B5k!$BD4Vu&?bM+1pscNs?|}TanB=Gw z>T*v6IVvN? z<7If|L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_h1z^@g1Ol|+4@tg8wGTC=#XOF2am>qfKn907Io>$+Q-Sqy_u7zJb-R}@W`8!UQ zcf@Io%VaV)??c4o52#O#V%#1nXgU+|F>@jCcpKZ_J&A z@3MF03-+%5t`!Vm@tMZ>tLZTRq8EaGtY0v9QyVgOxLGr^J1@q*V@d<={Y-i7cC%-3 zywbm3mfe^J;$ivj&b!(ametFDK5R`erNd12{AYbi%)83U;>Nr+5`MbsN-G#{3WIoD znEk*1TOcrh-{|8tGo`?++wTaNU3N3C@eIPM{E6?6zA8c)@KO^scH4!o_z?+Q%*wmn#jm(a1a)TTyWOP%NAtDac1wZ1xhWn_FxWi1+ucgwYJT#~ zK%Cb7e0;;4r?1`W?L2GkmJN~4qeqVV*Kp^l{{GI!Pod5s-l5(hTfH|7pBcC%Y-)se zXkdW%%=z;?=1iS7X}-tI8Os*TU*xgWJ0#REaEtTU;p2yoG{&*O-+OJSH$rdp4si|( zbPn_NcK$oTQ1A6&%>Twfe8iWHh}$_VWbFp;fVCl;o!5qih4`%tH+tC;80NR$I~2)> zggJMo|95_U!@`0ljTphgukFg)aKFHRbQ}R(I`1u^-XjEW3IYW|f=EG#z)#>K@D+p! zoCVVbYXw^c-muMrZHr(7zB>y>3q}e?3H~J*4*OJrKYq@ygbFpjc?&`jF2opm1ANXz z>{}4$R6zvXL-7^>a}gdNK{#Sq3%@f3^9Az+9)daWH4PnaKI}6EGX%>73t(S_x2487 zLyxYu^5reqXbk0y)C1uXhO)6Q|5RQUW<7kE;@^l6 zA+LmC@2nIomJp<|0saGwdEX4TwQyzbeu8x<)8DadK`8dN9==1n>mmd$toB~5jen|b s)(&B4mq{38BT$mA^w<7dxZ%e9{-66Cfg0+{%@$)VvB8fK@L&J^FN3;7EdT%j literal 0 HcmV?d00001 diff --git a/client/Pods/FontAwesome.swift/FontAwesome/FontAwesome.swift b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesome.swift new file mode 100644 index 00000000..ab48c039 --- /dev/null +++ b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesome.swift @@ -0,0 +1,182 @@ +// FontAwesome.swift +// +// Copyright (c) 2014-present FontAwesome.swift contributors +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit +import CoreText + +// MARK: - Public + +/// A configuration namespace for FontAwesome. +public struct FontAwesomeConfig { + + // Marked private to prevent initialization of this struct. + private init(){} + + /// A static member that holds the FontAwesome font name. + static let name = "FontAwesome" + + /// Taken from FontAwesome.io's Fixed Width Icon CSS. + public static let fontAspectRatio: CGFloat = 1.28571429 +} + +/// A FontAwesome extension to UIFont. +public extension UIFont { + + /// Get a UIFont object of FontAwesome. + /// + /// - parameter ofSize: The preferred font size. + /// - returns: A UIFont object of FontAwesome. + public class func fontAwesome(ofSize fontSize: CGFloat) -> UIFont { + loadFontAwesome() + return UIFont(name: FontAwesomeConfig.name, size: fontSize)! + } + + /// Loads the FontAwesome font in to memory. + /// This method should be called when setting icons without using code. + public class func loadFontAwesome() { + + if !UIFont.fontNames(forFamilyName: FontAwesomeConfig.name).isEmpty { + return + } + + FontLoader.loadFont(FontAwesomeConfig.name) + } +} + +/// A FontAwesome extension to String. +public extension String { + + /// Get a FontAwesome icon string with the given icon name. + /// + /// - parameter name: The preferred icon name. + /// - returns: A string that will appear as icon with FontAwesome. + public static func fontAwesomeIcon(name: FontAwesome) -> String { + let toIndex = name.rawValue.index(name.rawValue.startIndex, offsetBy: 1) + return String(name.rawValue[name.rawValue.startIndex.. String? { + + guard let name = self.fontAwesome(code: code) else { + return nil + } + + return self.fontAwesomeIcon(name: name) + } + + /// Get a FontAwesome icon with the given CSS icon code. Icon code can be found here: http://fontawesome.io/icons/ + /// + /// - parameter code: The preferred icon name. + /// - returns: An internal corresponding FontAwesome code. + public static func fontAwesome(code: String) -> FontAwesome? { + guard let raw = FontAwesomeIcons[code] else { return nil } + return FontAwesome(rawValue: raw) + } +} + +/// A FontAwesome extension to UIImage. +public extension UIImage { + + /// Get a FontAwesome image with the given icon name, text color, size and an optional background color. + /// + /// - parameter name: The preferred icon name. + /// - parameter textColor: The text color. + /// - parameter size: The image size. + /// - parameter backgroundColor: The background color (optional). + /// - returns: A string that will appear as icon with FontAwesome + public static func fontAwesomeIcon(name: FontAwesome, textColor: UIColor, size: CGSize, backgroundColor: UIColor = UIColor.clear, borderWidth: CGFloat = 0, borderColor: UIColor = UIColor.clear) -> UIImage { + + // Prevent application crash when passing size where width or height is set equal to or less than zero, by clipping width and height to a minimum of 1 pixel. + var size = size + if size.width <= 0 { size.width = 1 } + if size.height <= 0 { size.height = 1 } + + let paragraph = NSMutableParagraphStyle() + paragraph.alignment = NSTextAlignment.center + + let fontSize = min(size.width / FontAwesomeConfig.fontAspectRatio, size.height) + + // stroke width expects a whole number percentage of the font size + let strokeWidth: CGFloat = fontSize == 0 ? 0 : (-100 * borderWidth / fontSize) + + let attributedString = NSAttributedString(string: String.fontAwesomeIcon(name: name), attributes: [ + NSAttributedStringKey.font: UIFont.fontAwesome(ofSize: fontSize), + NSAttributedStringKey.foregroundColor: textColor, + NSAttributedStringKey.backgroundColor: backgroundColor, + NSAttributedStringKey.paragraphStyle: paragraph, + NSAttributedStringKey.strokeWidth: strokeWidth, + NSAttributedStringKey.strokeColor: borderColor + ]) + + UIGraphicsBeginImageContextWithOptions(size, false, 0.0) + attributedString.draw(in: CGRect(x: 0, y: (size.height - fontSize) / 2, width: size.width, height: fontSize)) + let image = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + return image! + } + + /// Get a FontAwesome image with the given icon css code, text color, size and an optional background color. + /// + /// - parameter code: The preferred icon css code. + /// - parameter textColor: The text color. + /// - parameter size: The image size. + /// - parameter backgroundColor: The background color (optional). + /// - returns: A string that will appear as icon with FontAwesome + public static func fontAwesomeIcon(code: String, textColor: UIColor, size: CGSize, backgroundColor: UIColor = UIColor.clear, borderWidth: CGFloat = 0, borderColor: UIColor = UIColor.clear) -> UIImage? { + guard let name = String.fontAwesome(code: code) else { return nil } + return fontAwesomeIcon(name: name, textColor: textColor, size: size, backgroundColor: backgroundColor, borderWidth: borderWidth, borderColor: borderColor) + } +} + +// MARK: - Private + +private class FontLoader { + class func loadFont(_ name: String) { + let bundle = Bundle(for: FontLoader.self) + let identifier = bundle.bundleIdentifier + + var fontURL: URL + if identifier?.hasPrefix("org.cocoapods") == true { + // If this framework is added using CocoaPods, resources is placed under a subdirectory + fontURL = bundle.url(forResource: name, withExtension: "otf", subdirectory: "FontAwesome.swift.bundle")! + } else { + fontURL = bundle.url(forResource: name, withExtension: "otf")! + } + + guard + let data = try? Data(contentsOf: fontURL), + let provider = CGDataProvider(data: data as CFData), + let font = CGFont(provider) + else { return } + + var error: Unmanaged? + if !CTFontManagerRegisterGraphicsFont(font, &error) { + let errorDescription: CFString = CFErrorCopyDescription(error!.takeUnretainedValue()) + guard let nsError = error?.takeUnretainedValue() as AnyObject as? NSError else { return } + NSException(name: NSExceptionName.internalInconsistencyException, reason: errorDescription as String, userInfo: [NSUnderlyingErrorKey: nsError]).raise() + } + } +} diff --git a/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeBarButtonItem.swift b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeBarButtonItem.swift new file mode 100644 index 00000000..7063da76 --- /dev/null +++ b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeBarButtonItem.swift @@ -0,0 +1,73 @@ +// FontAwesomeBarButtonItem.swift +// +// Copyright (c) 2017 Maik639 +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +@IBDesignable public class FontAwesomeBarButtonItem: UIBarButtonItem { + + @IBInspectable public var isFontAwesomeCSSCode: Bool = true + @IBInspectable public var size: CGFloat = 25.0 + + public override func awakeFromNib() { + super.awakeFromNib() + useFontAwesome() + } + + public override func prepareForInterfaceBuilder() { + useFontAwesome() + } + + private func useFontAwesome() { + updateText { + if let cssCode = title { + title = String.fontAwesomeIcon(code: cssCode) + } + } + updateFontAttributes { (state, font) in + let currentAttributes = titleTextAttributes(for: state) ?? [:] + var attributes = [NSAttributedStringKey: Any]() + currentAttributes.enumerated().forEach { + let currentAttribute = NSAttributedStringKey(rawValue: $0.element.key) + attributes[currentAttribute] = $0.element.value + } + attributes[NSAttributedStringKey.font] = font + setTitleTextAttributes(attributes, for: state) + } + } + +} + +extension FontAwesomeBarButtonItem: FontAwesomeTextRepresentable { + + var isTextCSSCode: Bool { + return isFontAwesomeCSSCode + } + + var textSize: CGFloat { + return size + } + + static func supportedStates() -> [UIControlState] { + return [.normal, .highlighted, .disabled] + } + +} diff --git a/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeImageRepresentable.swift b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeImageRepresentable.swift new file mode 100644 index 00000000..53da2fdb --- /dev/null +++ b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeImageRepresentable.swift @@ -0,0 +1,55 @@ +// FontAwesomeImageRepresentable.swift +// +// Copyright (c) 2017 Maik639 +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +protocol FontAwesomeImageRepresentable: class { + + typealias ImageConfig = (cssIconName: String, color: UIColor?, backgroundColor: UIColor?) + + var imageWidth: CGFloat { get } + var imageConfigs: [ImageConfig] { get } + + func createImages(configurationHandler: (_ image: UIImage?, _ index: Int) -> Void) +} + +extension FontAwesomeImageRepresentable { + + func createImages(configurationHandler: (_ image: UIImage?, _ index: Int) -> Void) { + let imgSize = imageSizeForAspectRatio() + for (index, config) in imageConfigs.enumerated() { + let img = createImage(config: config, size: imgSize) + configurationHandler(img, index) + } + } + + private func createImage(config: ImageConfig, size: CGSize) -> UIImage? { + return UIImage.fontAwesomeIcon(code: config.cssIconName, + textColor: config.color ?? .black, + size: size, + backgroundColor: config.backgroundColor ?? .clear) + } + + private func imageSizeForAspectRatio() -> CGSize { + return CGSize(width: imageWidth, height: imageWidth / FontAwesomeConfig.fontAspectRatio) + } +} diff --git a/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeImageView.swift b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeImageView.swift new file mode 100644 index 00000000..9e4adc23 --- /dev/null +++ b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeImageView.swift @@ -0,0 +1,58 @@ +// FontAwesomeImageView.swift +// +// Copyright (c) 2017 Maik639 +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +@IBDesignable public class FontAwesomeImageView: UIImageView { + + @IBInspectable public var cssCode: String = "fa-square-o" + @IBInspectable public var imageColor: UIColor = .black + @IBInspectable public var imageBackgroundColor: UIColor = .clear + + public override func awakeFromNib() { + super.awakeFromNib() + useFontAwesomeImage() + } + + public override func prepareForInterfaceBuilder() { + useFontAwesomeImage() + } + + private func useFontAwesomeImage() { + createImages { (img, _) in + image = img + } + } + +} + +extension FontAwesomeImageView: FontAwesomeImageRepresentable { + + var imageWidth: CGFloat { + return frame.width + } + + var imageConfigs: [ImageConfig] { + return [(cssCode, imageColor, imageBackgroundColor)] + } + +} diff --git a/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeSegmentedControl.swift b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeSegmentedControl.swift new file mode 100644 index 00000000..b27b5572 --- /dev/null +++ b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeSegmentedControl.swift @@ -0,0 +1,74 @@ +// FontAwesomeSegmentedControl.swift +// +// Copyright (c) 2017 Maik639 +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +@IBDesignable public class FontAwesomeSegmentedControl: UISegmentedControl { + + @IBInspectable public var isFontAwesomeCSSCode: Bool = true + @IBInspectable public var size: CGFloat = 22.0 + + public override func awakeFromNib() { + super.awakeFromNib() + useFontAwesome() + } + + public override func prepareForInterfaceBuilder() { + useFontAwesome() + } + + private func useFontAwesome() { + updateText { + for i in 0 ..< numberOfSegments { + if let cssCode = titleForSegment(at: i) { + setTitle(String.fontAwesomeIcon(code: cssCode), forSegmentAt: i) + } + } + } + updateFontAttributes { (state, font) in + var attributes = titleTextAttributes(for: state) ?? [:] + attributes[NSAttributedStringKey.font] = font + setTitleTextAttributes(attributes, for: state) + } + } + +} + +extension FontAwesomeSegmentedControl: FontAwesomeTextRepresentable { + + var isTextCSSCode: Bool { + return isFontAwesomeCSSCode + } + + var textSize: CGFloat { + return size + } + + static func supportedStates() -> [UIControlState] { + if #available(iOS 9.0, *) { + return [.normal, .highlighted, .disabled, .focused, .selected, .application, .reserved] + } else { + return [.normal, .highlighted, .disabled, .selected, .application, .reserved] + } + } + +} diff --git a/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeStateRequirement.swift b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeStateRequirement.swift new file mode 100644 index 00000000..f6f3bfd8 --- /dev/null +++ b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeStateRequirement.swift @@ -0,0 +1,29 @@ +// FontAwesomeStateRequirement.swift +// +// Copyright (c) 2017 Maik639 +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +protocol FontAwesomeStateRequirement: class { + + static func supportedStates() -> [UIControlState] + +} diff --git a/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeTabBarItem.swift b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeTabBarItem.swift new file mode 100644 index 00000000..e025db83 --- /dev/null +++ b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeTabBarItem.swift @@ -0,0 +1,62 @@ +// FontAwesomeTabBarItem.swift +// +// Copyright (c) 2017 Maik639 +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +@IBDesignable public class FontAwesomeTabBarItem: UITabBarItem { + + @IBInspectable public var iconName: String = "fa-square-o" + @IBInspectable public var selectedIconName: String = "fa-square" + @IBInspectable public var size: CGFloat = 38.0 + + public override func awakeFromNib() { + super.awakeFromNib() + useFontAwesomeImage() + } + + public override func prepareForInterfaceBuilder() { + useFontAwesomeImage() + } + + private func useFontAwesomeImage() { + createImages { (img, index) in + if index == 0 { + image = img + } else { + selectedImage = img + } + } + } + +} + +extension FontAwesomeTabBarItem: FontAwesomeImageRepresentable { + + var imageWidth: CGFloat { + return size + } + + var imageConfigs: [ImageConfig] { + return [(iconName, nil, nil), (selectedIconName, nil, nil)] + } + +} diff --git a/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeTextRepresentable.swift b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeTextRepresentable.swift new file mode 100644 index 00000000..a02dc07a --- /dev/null +++ b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeTextRepresentable.swift @@ -0,0 +1,53 @@ +// FontAwesomeTextRepresentable.swift +// +// Copyright (c) 2017 Maik639 +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +protocol FontAwesomeTextRepresentable : FontAwesomeStateRequirement { + + var textSize: CGFloat { get } + var isTextCSSCode: Bool { get } + + func updateText(_ updateTextBlock: () -> Void) + func updateFontAttributes(forStates stateBlock: (UIControlState, UIFont) -> Void) + +} + +extension FontAwesomeTextRepresentable { + + public func updateText(_ updateTextBlock: () -> Void) { + guard isTextCSSCode else { + return + } + + updateTextBlock() + } + + public func updateFontAttributes(forStates stateBlock: (UIControlState, UIFont) -> Void) { + let states = type(of: self).supportedStates() + let font = UIFont.fontAwesome(ofSize: textSize) + + for state in states { + stateBlock(state, font) + } + } +} diff --git a/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeView.swift b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeView.swift new file mode 100644 index 00000000..ecc31007 --- /dev/null +++ b/client/Pods/FontAwesome.swift/FontAwesome/FontAwesomeView.swift @@ -0,0 +1,70 @@ +// FontAwesomeView.swift +// +// Copyright (c) 2016 Antony Alkmim +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +/// A view for FontAwesome icons. +@IBDesignable public class FontAwesomeView: UIView { + + @IBInspectable + public var iconCode: String = "" { + didSet { + self.iconView.text = String.fontAwesomeIcon(code: iconCode) + } + } + + private var iconView = UILabel() + + override init(frame: CGRect) { + super.init(frame: frame) + setupViews() + } + + required public init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + setupViews() + } + + override public func prepareForInterfaceBuilder() { + setupViews() + } + + /// Add a UILabel subview containing FontAwesome icon + func setupViews() { + // Fits icon in the view + self.iconView.textAlignment = NSTextAlignment.center + self.iconView.text = String.fontAwesomeIcon(code: self.iconCode) + self.iconView.textColor = self.tintColor + self.addSubview(iconView) + } + + override public func tintColorDidChange() { + self.iconView.textColor = self.tintColor + } + + override public func layoutSubviews() { + super.layoutSubviews() + self.clipsToBounds = true + self.iconView.font = UIFont.fontAwesome(ofSize: bounds.size.width < bounds.size.height ? bounds.size.width : bounds.size.height) + self.iconView.frame = CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize(width: bounds.size.width, height: bounds.size.height)) + } +} diff --git a/client/Pods/FontAwesome.swift/LICENSE b/client/Pods/FontAwesome.swift/LICENSE new file mode 100644 index 00000000..8dde6c9e --- /dev/null +++ b/client/Pods/FontAwesome.swift/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-present FontAwesome.swift contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/client/Pods/FontAwesome.swift/README.md b/client/Pods/FontAwesome.swift/README.md new file mode 100644 index 00000000..f799259d --- /dev/null +++ b/client/Pods/FontAwesome.swift/README.md @@ -0,0 +1,98 @@ +# FontAwesome.swift + +[![Build Status](http://img.shields.io/travis/thii/FontAwesome.swift.svg?style=flat)](https://travis-ci.org/thii/FontAwesome.swift) +[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/FontAwesome.swift.svg)](https://img.shields.io/cocoapods/v/FontAwesome.swift.svg) +[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![Platform](https://img.shields.io/cocoapods/p/FontAwesome.swift.svg?style=flat)](http://cocoadocs.org/docsets/FontAwesome.swift) +[![License](https://img.shields.io/cocoapods/l/FontAwesome.swift.svg)](https://raw.githubusercontent.com/thii/FontAwesome.swift/master/LICENSE) + +Use Font Awesome in your Swift projects + +## Installation + +Since this is a Swift project, integrating using Carthage is the recommended way. Releases which support CocoaPods might be delayed sometimes. + +### Carthage + +To integrate FontAwesome into your Xcode project using Carthage, specify it in your `Cartfile`: + +```ogdl +github "thii/FontAwesome.swift" +``` + +Then add `import FontAwesome` to the top of the files using FontAwesome. + +### CocoaPods + +To integrate FontAwesome into your Xcode project using CocoaPods, specify it in your `Podfile`: + +```ruby +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '8.0' +use_frameworks! + +pod 'FontAwesome.swift' +``` + +Then, run the following command: + +```bash +$ pod install +``` + +And add `import FontAwesome_swift` to the top of the files using FontAwesome. + +### Manually +- Drag and drop `FontAwesome.otf` and all Swift files into your project + +## Examples + +### FontAwesome icon in label +```swift +label.font = UIFont.fontAwesome(ofSize: 100) +label.text = String.fontAwesomeIcon(name: .github) +``` + +### FontAwesome icon in label from css class name +```swift +label.font = UIFont.fontAwesome(ofSize: 200) +label.text = String.fontAwesomeIcon(code: "fa-github") +``` + +### FontAwesome icon in button +```swift +button.titleLabel?.font = UIFont.fontAwesome(ofSize: 30) +button.setTitle(String.fontAwesomeIcon(name: .github), for: .normal) +``` + +### FontAwesome icon as navigation bar item +```swift +let attributes = [NSFontAttributeName: UIFont.fontAwesome(ofSize: 20)] as [String: Any] +leftBarButton.setTitleTextAttributes(attributes, for: .normal) +leftBarButton.title = String.fontAwesomeIcon(name: .github) +``` + +### FontAwesome icon as toolbar item +```swift +let attributes = [NSFontAttributeName: UIFont.fontAwesome(ofSize: 20)] as [String: Any] +toolbarItem.setTitleTextAttributes(attributes, for: .normal) +toolbarItem.title = String.fontAwesomeIcon(name: .github) +``` + +### FontAwesome icon as an image +```swift +tabBarItem.image = UIImage.fontAwesomeIcon(name: .github, textColor: UIColor.black, size: CGSize(width: 30, height: 30)) +``` + +### FontAwesome icon as an image with background color +```swift +tabBarItem.image = UIImage.fontAwesomeIcon(name: .github, textColor: UIColor.blue, size: CGSize(width: 4000, height: 4000), backgroundColor: UIColor.red) +``` + +## Requirements + +iOS 8 or later. + +## License +- FontAwesome.otf file licensed under [SIL OFL 1.1](http://scripts.sil.org/OFL) +- FontAwesome.swift licensed under [MIT](http://thi.mit-license.org/) diff --git a/client/Pods/Manifest.lock b/client/Pods/Manifest.lock new file mode 100644 index 00000000..72445d44 --- /dev/null +++ b/client/Pods/Manifest.lock @@ -0,0 +1,28 @@ +PODS: + - Alamofire (4.5.1) + - FontAwesome.swift (1.3.2) + - Moya (10.0.0): + - Moya/Core (= 10.0.0) + - Moya/Core (10.0.0): + - Alamofire (~> 4.1) + - Result (~> 3.0) + - Result (3.2.4) + - SDWebImage (4.2.2): + - SDWebImage/Core (= 4.2.2) + - SDWebImage/Core (4.2.2) + +DEPENDENCIES: + - FontAwesome.swift + - Moya + - SDWebImage + +SPEC CHECKSUMS: + Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a + FontAwesome.swift: b4e4c8ccbbecb12f9b592bc533ff237af3706667 + Moya: adb58b0f4e58430db43cc6e2f6ebab1836501186 + Result: d2d07204ce72856f1fd9130bbe42c35a7b0fea10 + SDWebImage: 89a9d32cd520bbb46eb14e541d5109b3564af198 + +PODFILE CHECKSUM: 63b743108d1d7464ec33801a55ca17bbb8f865ae + +COCOAPODS: 1.3.1 diff --git a/client/Pods/Moya/License.md b/client/Pods/Moya/License.md new file mode 100644 index 00000000..e91aa385 --- /dev/null +++ b/client/Pods/Moya/License.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Artsy, Ash Furrow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/client/Pods/Moya/Readme.md b/client/Pods/Moya/Readme.md new file mode 100644 index 00000000..7b1a4fc3 --- /dev/null +++ b/client/Pods/Moya/Readme.md @@ -0,0 +1,322 @@ +[![CircleCI](https://img.shields.io/circleci/project/github/Moya/Moya/master.svg)](https://circleci.com/gh/Moya/Moya/tree/master) +[![codecov.io](https://codecov.io/github/Moya/Moya/coverage.svg?branch=master)](https://codecov.io/github/Moya/Moya?branch=master) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![CocoaPods compatible](https://img.shields.io/cocoapods/v/Moya.svg)](https://cocoapods.org/pods/Moya) +[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager) + + + +

+ +

+ +## Documentation in Chinese + +**All docs in "docs_CN". [Go](Readme_CN.md)** + + + +You're a smart developer. You probably use [Alamofire](https://github.com/Alamofire/Alamofire) to abstract away access to +`URLSession` and all those nasty details you don't really care about. But then, +like lots of smart developers, you write ad hoc network abstraction layers. They +are probably called "APIManager" or "NetworkModel", and they always end in tears. + +![Moya Overview](web/diagram.png) + +Ad hoc network layers are common in iOS apps. They're bad for a few reasons: + +- Makes it hard to write new apps ("where do I begin?") +- Makes it hard to maintain existing apps ("oh my god, this mess...") +- Makes it hard to write unit tests ("how do I do this again?") + +So the basic idea of Moya is that we want some network abstraction layer that +sufficiently encapsulates actually calling Alamofire directly. It should be simple +enough that common things are easy, but comprehensive enough that complicated things +are also easy. + +> If you use Alamofire to abstract away `URLSession`, why not use something +to abstract away the nitty gritty of URLs, parameters, etc? + +Some awesome features of Moya: + +- Compile-time checking for correct API endpoint accesses. +- Lets you define a clear usage of different endpoints with associated enum values. +- Treats test stubs as first-class citizens so unit testing is super-easy. + +You can check out more about the project direction in the [vision document](Vision.md). + +## Sample Project + +There's a sample project in the Demo directory. To use it, run `pod install` to download the required libraries. Have fun! + +## Project Status + +This project is actively under development, and is being used in [Artsy's +new auction app](https://github.com/Artsy/eidolon). We consider it +ready for production use. + +## Installation + +### Moya version vs Swift version. + +Below is a table that shows which version of Moya you should use for +your Swift version. + +| Swift | Moya | RxMoya | ReactiveMoya | +| ----- | ------------- |---------------|---------------| +| 4.X | >= 9.0 | >= 10.0 | >= 9.0 | +| 3.X | 8.0.0 - 8.0.5 | 8.0.0 - 8.0.5 | 8.0.0 - 8.0.5 | +| 2.3 | 7.0.2 - 7.0.4 | 7.0.2 - 7.0.4 | 7.0.2 - 7.0.4 | +| 2.2 | <= 7.0.1 | <= 7.0.1 | <= 7.0.1 | + +**Upgrading to a new major version of Moya? Check out our [migration guides](https://github.com/Moya/Moya/blob/master/docs/MigrationGuides).** + +### Swift Package Manager + +To integrate using Apple's Swift package manager, add the following as a dependency to your `Package.swift`: + +```swift +.package(url: "https://github.com/Moya/Moya.git", .exact("10.0.0-beta.1") +``` + +and then specify `"Moya"` as a dependency of the Target in which you wish to use Moya. +If you want to use reactive extensions, add also `"ReactiveMoya"` or `"RxMoya"` as your Target dependency respectively. +Here's an example `PackageDescription`: + +```swift +// swift-tools-version:4.0 +import PackageDescription + +let package = Package( + name: "MyPackage", + products: [ + .library( + name: "MyPackage", + targets: ["MyPackage"]), + ], + dependencies: [ + .package(url: "https://github.com/Moya/Moya.git", .exact("10.0.0-beta.1") + ], + targets: [ + .target( + name: "MyPackage", + dependencies: ["ReactiveMoya"]) + ] +) +``` + +Note that as of Moya 10, SPM only works with Swift 4 toolchain and greater. + +### CocoaPods + +For Moya, use the following entry in your Podfile: + +```rb +pod 'Moya' + +# or + +pod 'Moya/RxSwift' + +# or + +pod 'Moya/ReactiveSwift' +``` + +Then run `pod install`. + +In any file you'd like to use Moya in, don't forget to +import the framework with `import Moya`. + +### Carthage + +Carthage users can point to this repository and use whichever +generated framework they'd like, `Moya`, `RxMoya`, or `ReactiveMoya`. + +Make the following entry in your Cartfile: + +``` +github "Moya/Moya" +``` + +Then run `carthage update`. + +If this is your first time using Carthage in the project, you'll need to go through some additional steps as explained [over at Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application). + +### Manually + +- Open up Terminal, `cd` into your top-level project directory, and run the following command *if* your project is not initialized as a git repository: + +```bash +$ git init +``` + +- Add Alamofire, Result & Moya as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following commands: + +```bash +$ git submodule add https://github.com/Alamofire/Alamofire.git +$ git submodule add https://github.com/antitypical/Result.git +$ git submodule add https://github.com/Moya/Moya.git +``` + +- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. Do the same with the `Result.xcodeproj` in the `Result` folder and `Moya.xcodeproj` in the `Moya` folder. + +> They should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. + +- Verify that the deployment targets of the `xcodeproj`s match that of your application target in the Project Navigator. +- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. +- In the tab bar at the top of that window, open the "General" panel. +- Click on the `+` button under the "Embedded Binaries" section. +- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. + +> It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. + +- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. + +> You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS`, `Alamofire macOS`, `Alamofire tvOS` or `Alamofire watchOS`. + +- Click on the `+` button under "Embedded Binaries" again and add the build target you need for `Result`. +- Click on the `+` button again and add the correct build target for `Moya`. + +- And that's it! + +> The three frameworks are automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. + +## Usage + +After [some setup](docs/Examples/Basic.md), using Moya is really simple. You can access an API like this: + +```swift +provider = MoyaProvider() +provider.request(.zen) { result in + switch result { + case let .success(moyaResponse): + let data = moyaResponse.data + let statusCode = moyaResponse.statusCode + // do something with the response data or statusCode + case let .failure(error): + // this means there was a network failure - either the request + // wasn't sent (connectivity), or no response was received (server + // timed out). If the server responds with a 4xx or 5xx error, that + // will be sent as a ".success"-ful response. + } +} +``` + +That's a basic example. Many API requests need parameters. Moya encodes these +into the enum you use to access the endpoint, like this: + +```swift +provider = MoyaProvider() +provider.request(.userProfile("ashfurrow")) { result in + // do something with the result +} +``` + +No more typos in URLs. No more missing parameter values. No more messing with +parameter encoding. + +For more examples, see the [documentation](docs/Examples). + +## Reactive Extensions + +Even cooler are the reactive extensions. Moya provides reactive extensions for +[ReactiveSwift](https://github.com/ReactiveCocoa/ReactiveSwift) and +[RxSwift](https://github.com/ReactiveX/RxSwift). + +### ReactiveSwift + +[`ReactiveSwift` extension](docs/ReactiveSwift.md) provides both `reactive.request(:callbackQueue:)` and +`reactive.requestWithProgress(:callbackQueue:)` methods that immediately return +`SignalProducer`s that you can start, bind, map, or whatever you want to do. +To handle errors, for instance, we could do the following: + +```swift +provider = MoyaProvider() +provider.reactive.request(.userProfile("ashfurrow")).start { event in + switch event { + case let .value(response): + image = UIImage(data: response.data) + case let .failed(error): + print(error) + default: + break + } +} +``` + +### RxSwift + +[`RxSwift` extension](docs/RxSwift.md) also provide both `rx.request(:callbackQueue:)` and +`rx.requestWithProgress(:callbackQueue:)` methods, but return type is +different for both. In case of a normal `rx.request(:callbackQueue)`, the +return type is `Single` which emits either single element or an +error. In case of a `rx.requestWithProgress(:callbackQueue:)`, the return +type is `Observable`, since we may get multiple events +from progress and one last event which is a response. + +To handle errors, for instance, we could do the following: + +```swift +provider = MoyaProvider() +provider.rx.request(.userProfile("ashfurrow")).subscribe { event in + switch event { + case let .success(response): + image = UIImage(data: response.data) + case let .error(error): + print(error) + } +} +``` + +In addition to the option of using signals instead of callback blocks, there are +also a series of signal operators for RxSwift and ReactiveSwift that will attempt +to map the data received from the network response into either an image, some JSON, +or a string, with `mapImage()`, `mapJSON()`, and `mapString()`, respectively. If the mapping is unsuccessful, you'll get an error on the signal. You also get handy methods +for filtering out certain status codes. This means that you can place your code for +handling API errors like 400's in the same places as code for handling invalid +responses. + +## Community Projects + +[Moya has a great community around it and some people have created some very helpful extensions.](https://github.com/Moya/Moya/blob/master/docs/CommunityProjects.md) + +## Contributing + +Hey! Do you like Moya? Awesome! We could actually really use your help! + +Open source isn't just writing code. Moya could use your help with any of the +following: + +- Finding (and reporting!) bugs. +- New feature suggestions. +- Answering questions on issues. +- Documentation improvements. +- Reviewing pull requests. +- Helping to manage issue priorities. +- Fixing bugs/new features. + +If any of that sounds cool to you, send a pull request! After a few +contributions, we'll add you as an admin to the repo so you can merge pull +requests and help steer the ship :ship: You can read more details about that [in our contributor guidelines](https://github.com/Moya/Moya/blob/master/Contributing.md). + +Moya's community has a tremendous positive energy, and the maintainers are committed to keeping things awesome. Like [in the CocoaPods community](https://github.com/CocoaPods/CocoaPods/wiki/Communication-&-Design-Rules), always assume positive intent; even if a comment sounds mean-spirited, give the person the benefit of the doubt. + +Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by [its terms](https://github.com/Moya/Moya/blob/master/Code%20of%20Conduct.md). + +### Adding new source files + +If you add or remove a source file from Moya, a corresponding change needs to be made to the `Moya.xcodeproj` project at the root of this repository. This project is used for Carthage. Don't worry, you'll get an automated warning when submitting a pull request if you forget. + +### Help us improve Moya documentation +Whether you’re a core member or a user trying it out for the first time, you can make a valuable contribution to Moya by improving the documentation. Help us by: + +- sending us feedback about something you thought was confusing or simply missing +- suggesting better wording or ways of explaining certain topics +- sending us a pull request via GitHub +- improving the [Chinese documentation](Readme_CN.md) + + +## License + +Moya is released under an MIT license. See [License.md](License.md) for more information. diff --git a/client/Pods/Moya/Sources/Moya/AnyEncodable.swift b/client/Pods/Moya/Sources/Moya/AnyEncodable.swift new file mode 100644 index 00000000..15c7128e --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/AnyEncodable.swift @@ -0,0 +1,14 @@ +import Foundation + +struct AnyEncodable: Encodable { + + private let encodable: Encodable + + public init(_ encodable: Encodable) { + self.encodable = encodable + } + + func encode(to encoder: Encoder) throws { + try encodable.encode(to: encoder) + } +} diff --git a/client/Pods/Moya/Sources/Moya/Cancellable.swift b/client/Pods/Moya/Sources/Moya/Cancellable.swift new file mode 100644 index 00000000..135f3a69 --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/Cancellable.swift @@ -0,0 +1,22 @@ +/// Protocol to define the opaque type returned from a request +public protocol Cancellable { + var isCancelled: Bool { get } + func cancel() +} + +internal class CancellableWrapper: Cancellable { + internal var innerCancellable: Cancellable = SimpleCancellable() + + var isCancelled: Bool { return innerCancellable.isCancelled } + + internal func cancel() { + innerCancellable.cancel() + } +} + +internal class SimpleCancellable: Cancellable { + var isCancelled = false + func cancel() { + isCancelled = true + } +} diff --git a/client/Pods/Moya/Sources/Moya/Endpoint.swift b/client/Pods/Moya/Sources/Moya/Endpoint.swift new file mode 100755 index 00000000..2125a46b --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/Endpoint.swift @@ -0,0 +1,120 @@ +import Foundation + +/// Used for stubbing responses. +public enum EndpointSampleResponse { + + /// The network returned a response, including status code and data. + case networkResponse(Int, Data) + + /// The network returned response which can be fully customized. + case response(HTTPURLResponse, Data) + + /// The network failed to send the request, or failed to retrieve a response (eg a timeout). + case networkError(NSError) +} + +/// Class for reifying a target of the `Target` enum unto a concrete `Endpoint`. +open class Endpoint { + public typealias SampleResponseClosure = () -> EndpointSampleResponse + + open let url: String + open let sampleResponseClosure: SampleResponseClosure + open let method: Moya.Method + open let task: Task + open let httpHeaderFields: [String: String]? + + /// Main initializer for `Endpoint`. + public init(url: String, + sampleResponseClosure: @escaping SampleResponseClosure, + method: Moya.Method, + task: Task, + httpHeaderFields: [String: String]?) { + + self.url = url + self.sampleResponseClosure = sampleResponseClosure + self.method = method + self.task = task + self.httpHeaderFields = httpHeaderFields + } + + /// Convenience method for creating a new `Endpoint` with the same properties as the receiver, but with added HTTP header fields. + open func adding(newHTTPHeaderFields: [String: String]) -> Endpoint { + return Endpoint(url: url, sampleResponseClosure: sampleResponseClosure, method: method, task: task, httpHeaderFields: add(httpHeaderFields: newHTTPHeaderFields)) + } + + /// Convenience method for creating a new `Endpoint` with the same properties as the receiver, but with replaced `task` parameter. + open func replacing(task: Task) -> Endpoint { + return Endpoint(url: url, sampleResponseClosure: sampleResponseClosure, method: method, task: task, httpHeaderFields: httpHeaderFields) + } + + fileprivate func add(httpHeaderFields headers: [String: String]?) -> [String: String]? { + guard let unwrappedHeaders = headers, unwrappedHeaders.isEmpty == false else { + return self.httpHeaderFields + } + + var newHTTPHeaderFields = self.httpHeaderFields ?? [:] + unwrappedHeaders.forEach { key, value in + newHTTPHeaderFields[key] = value + } + return newHTTPHeaderFields + } +} + +/// Extension for converting an `Endpoint` into a `URLRequest`. +extension Endpoint { + /// Returns the `Endpoint` converted to a `URLRequest` if valid. Throws an error otherwise. + public func urlRequest() throws -> URLRequest { + guard let requestURL = Foundation.URL(string: url) else { + throw MoyaError.requestMapping(url) + } + + var request = URLRequest(url: requestURL) + request.httpMethod = method.rawValue + request.allHTTPHeaderFields = httpHeaderFields + + switch task { + case .requestPlain, .uploadFile, .uploadMultipart, .downloadDestination: + return request + case .requestData(let data): + request.httpBody = data + return request + case let .requestJSONEncodable(encodable): + return try request.encoded(encodable: encodable) + case let .requestParameters(parameters, parameterEncoding): + return try request.encoded(parameters: parameters, parameterEncoding: parameterEncoding) + case let .uploadCompositeMultipart(_, urlParameters): + let parameterEncoding = URLEncoding(destination: .queryString) + return try request.encoded(parameters: urlParameters, parameterEncoding: parameterEncoding) + case let .downloadParameters(parameters, parameterEncoding, _): + return try request.encoded(parameters: parameters, parameterEncoding: parameterEncoding) + case let .requestCompositeData(bodyData: bodyData, urlParameters: urlParameters): + request.httpBody = bodyData + let parameterEncoding = URLEncoding(destination: .queryString) + return try request.encoded(parameters: urlParameters, parameterEncoding: parameterEncoding) + case let .requestCompositeParameters(bodyParameters: bodyParameters, bodyEncoding: bodyParameterEncoding, urlParameters: urlParameters): + if bodyParameterEncoding is URLEncoding { fatalError("URLEncoding is disallowed as bodyEncoding.") } + let bodyfulRequest = try request.encoded(parameters: bodyParameters, parameterEncoding: bodyParameterEncoding) + let urlEncoding = URLEncoding(destination: .queryString) + return try bodyfulRequest.encoded(parameters: urlParameters, parameterEncoding: urlEncoding) + } + } +} + +/// Required for using `Endpoint` as a key type in a `Dictionary`. +extension Endpoint: Equatable, Hashable { + public var hashValue: Int { + let request = try? urlRequest() + return request?.hashValue ?? url.hashValue + } + + /// Note: If both Endpoints fail to produce a URLRequest the comparison will + /// fall back to comparing each Endpoint's hashValue. + public static func == (lhs: Endpoint, rhs: Endpoint) -> Bool { + let lhsRequest = try? lhs.urlRequest() + let rhsRequest = try? rhs.urlRequest() + if lhsRequest != nil, rhsRequest == nil { return false } + if lhsRequest == nil, rhsRequest != nil { return false } + if lhsRequest == nil, rhsRequest == nil { return lhs.hashValue == rhs.hashValue } + return (lhsRequest == rhsRequest) + } +} diff --git a/client/Pods/Moya/Sources/Moya/Image.swift b/client/Pods/Moya/Sources/Moya/Image.swift new file mode 100644 index 00000000..6e82908e --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/Image.swift @@ -0,0 +1,10 @@ +#if os(iOS) || os(watchOS) || os(tvOS) + import UIKit.UIImage + public typealias ImageType = UIImage +#elseif os(OSX) + import AppKit.NSImage + public typealias ImageType = NSImage +#endif + +/// An alias for the SDK's image type. +public typealias Image = ImageType diff --git a/client/Pods/Moya/Sources/Moya/Moya+Alamofire.swift b/client/Pods/Moya/Sources/Moya/Moya+Alamofire.swift new file mode 100644 index 00000000..a00579de --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/Moya+Alamofire.swift @@ -0,0 +1,88 @@ +import Foundation +import Alamofire + +public typealias Manager = Alamofire.SessionManager +internal typealias Request = Alamofire.Request +internal typealias DownloadRequest = Alamofire.DownloadRequest +internal typealias UploadRequest = Alamofire.UploadRequest +internal typealias DataRequest = Alamofire.DataRequest + +internal typealias URLRequestConvertible = Alamofire.URLRequestConvertible + +/// Represents an HTTP method. +public typealias Method = Alamofire.HTTPMethod + +/// Choice of parameter encoding. +public typealias ParameterEncoding = Alamofire.ParameterEncoding +public typealias JSONEncoding = Alamofire.JSONEncoding +public typealias URLEncoding = Alamofire.URLEncoding +public typealias PropertyListEncoding = Alamofire.PropertyListEncoding + +/// Multipart form +public typealias RequestMultipartFormData = Alamofire.MultipartFormData + +/// Multipart form data encoding result. +public typealias MultipartFormDataEncodingResult = Manager.MultipartFormDataEncodingResult +public typealias DownloadDestination = Alamofire.DownloadRequest.DownloadFileDestination + +/// Make the Alamofire Request type conform to our type, to prevent leaking Alamofire to plugins. +extension Request: RequestType { } + +/// Internal token that can be used to cancel requests +public final class CancellableToken: Cancellable, CustomDebugStringConvertible { + let cancelAction: () -> Void + let request: Request? + public fileprivate(set) var isCancelled = false + + fileprivate var lock: DispatchSemaphore = DispatchSemaphore(value: 1) + + public func cancel() { + _ = lock.wait(timeout: DispatchTime.distantFuture) + defer { lock.signal() } + guard !isCancelled else { return } + isCancelled = true + cancelAction() + } + + public init(action: @escaping () -> Void) { + self.cancelAction = action + self.request = nil + } + + init(request: Request) { + self.request = request + self.cancelAction = { + request.cancel() + } + } + + public var debugDescription: String { + guard let request = self.request else { + return "Empty Request" + } + return request.debugDescription + } + +} + +internal typealias RequestableCompletion = (HTTPURLResponse?, URLRequest?, Data?, Swift.Error?) -> Void + +internal protocol Requestable { + func response(callbackQueue: DispatchQueue?, completionHandler: @escaping RequestableCompletion) -> Self +} + +extension DataRequest: Requestable { + internal func response(callbackQueue: DispatchQueue?, completionHandler: @escaping RequestableCompletion) -> Self { + return response(queue: callbackQueue) { handler in + completionHandler(handler.response, handler.request, handler.data, handler.error) + } + } +} + +extension DownloadRequest: Requestable { + internal func response(callbackQueue: DispatchQueue?, completionHandler: @escaping RequestableCompletion) -> Self { + return response(queue: callbackQueue) { handler in + completionHandler(handler.response, handler.request, nil, handler.error) + } + } +} diff --git a/client/Pods/Moya/Sources/Moya/MoyaError.swift b/client/Pods/Moya/Sources/Moya/MoyaError.swift new file mode 100644 index 00000000..bbdb0dfd --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/MoyaError.swift @@ -0,0 +1,75 @@ +import Foundation + +public enum MoyaError: Swift.Error { + + /// Indicates a response failed to map to an image. + case imageMapping(Response) + + /// Indicates a response failed to map to a JSON structure. + case jsonMapping(Response) + + /// Indicates a response failed to map to a String. + case stringMapping(Response) + + /// Indicates a response failed to map to a Decodable object. + case objectMapping(Swift.Error, Response) + + /// Indicates that Encodable couldn't be encoded into Data + case encodableMapping(Swift.Error) + + /// Indicates a response failed with an invalid HTTP status code. + case statusCode(Response) + + /// Indicates a response failed due to an underlying `Error`. + case underlying(Swift.Error, Response?) + + /// Indicates that an `Endpoint` failed to map to a `URLRequest`. + case requestMapping(String) + + /// Indicates that an `Endpoint` failed to encode the parameters for the `URLRequest`. + case parameterEncoding(Swift.Error) +} + +public extension MoyaError { + /// Depending on error type, returns a `Response` object. + var response: Moya.Response? { + switch self { + case .imageMapping(let response): return response + case .jsonMapping(let response): return response + case .stringMapping(let response): return response + case .objectMapping(_, let response): return response + case .statusCode(let response): return response + case .underlying(_, let response): return response + case .encodableMapping: return nil + case .requestMapping: return nil + case .parameterEncoding: return nil + } + } +} + +// MARK: - Error Descriptions + +extension MoyaError: LocalizedError { + public var errorDescription: String? { + switch self { + case .imageMapping: + return "Failed to map data to an Image." + case .jsonMapping: + return "Failed to map data to JSON." + case .stringMapping: + return "Failed to map data to a String." + case .objectMapping: + return "Failed to map data to a Decodable object." + case .encodableMapping: + return "Failed to encode Encodable object into data." + case .statusCode: + return "Status code didn't fall within the given range." + case .requestMapping: + return "Failed to map Endpoint to a URLRequest." + case .parameterEncoding(let error): + return "Failed to encode parameters for URLRequest. \(error.localizedDescription)" + case .underlying(let error, _): + return error.localizedDescription + } + } +} diff --git a/client/Pods/Moya/Sources/Moya/MoyaProvider+Defaults.swift b/client/Pods/Moya/Sources/Moya/MoyaProvider+Defaults.swift new file mode 100644 index 00000000..493c8a29 --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/MoyaProvider+Defaults.swift @@ -0,0 +1,36 @@ +import Foundation + +/// These functions are default mappings to `MoyaProvider`'s properties: endpoints, requests, manager, etc. +public extension MoyaProvider { + public final class func defaultEndpointMapping(for target: Target) -> Endpoint { + return Endpoint( + url: URL(target: target).absoluteString, + sampleResponseClosure: { .networkResponse(200, target.sampleData) }, + method: target.method, + task: target.task, + httpHeaderFields: target.headers + ) + } + + public final class func defaultRequestMapping(for endpoint: Endpoint, closure: RequestResultClosure) { + do { + let urlRequest = try endpoint.urlRequest() + closure(.success(urlRequest)) + } catch MoyaError.requestMapping(let url) { + closure(.failure(MoyaError.requestMapping(url))) + } catch MoyaError.parameterEncoding(let error) { + closure(.failure(MoyaError.parameterEncoding(error))) + } catch { + closure(.failure(MoyaError.underlying(error, nil))) + } + } + + public final class func defaultAlamofireManager() -> Manager { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = Manager.defaultHTTPHeaders + + let manager = Manager(configuration: configuration) + manager.startRequestsImmediately = false + return manager + } +} diff --git a/client/Pods/Moya/Sources/Moya/MoyaProvider+Internal.swift b/client/Pods/Moya/Sources/Moya/MoyaProvider+Internal.swift new file mode 100644 index 00000000..2501b291 --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/MoyaProvider+Internal.swift @@ -0,0 +1,263 @@ +import Foundation +import Result + +// MARK: - Method + +extension Method { + public var supportsMultipart: Bool { + switch self { + case .post, .put, .patch, .connect: + return true + case .get, .delete, .head, .options, .trace: + return false + } + } +} + +// MARK: - MoyaProvider + +/// Internal extension to keep the inner-workings outside the main Moya.swift file. +public extension MoyaProvider { + /// Performs normal requests. + func requestNormal(_ target: Target, callbackQueue: DispatchQueue?, progress: Moya.ProgressBlock?, completion: @escaping Moya.Completion) -> Cancellable { + let endpoint = self.endpoint(target) + let stubBehavior = self.stubClosure(target) + let cancellableToken = CancellableWrapper() + + // Allow plugins to modify response + let pluginsWithCompletion: Moya.Completion = { result in + let processedResult = self.plugins.reduce(result) { $1.process($0, target: target) } + completion(processedResult) + } + + if trackInflights { + objc_sync_enter(self) + var inflightCompletionBlocks = self.inflightRequests[endpoint] + inflightCompletionBlocks?.append(pluginsWithCompletion) + self.inflightRequests[endpoint] = inflightCompletionBlocks + objc_sync_exit(self) + + if inflightCompletionBlocks != nil { + return cancellableToken + } else { + objc_sync_enter(self) + self.inflightRequests[endpoint] = [pluginsWithCompletion] + objc_sync_exit(self) + } + } + + let performNetworking = { (requestResult: Result) in + if cancellableToken.isCancelled { + self.cancelCompletion(pluginsWithCompletion, target: target) + return + } + + var request: URLRequest! + + switch requestResult { + case .success(let urlRequest): + request = urlRequest + case .failure(let error): + pluginsWithCompletion(.failure(error)) + return + } + + // Allow plugins to modify request + let preparedRequest = self.plugins.reduce(request) { $1.prepare($0, target: target) } + + let networkCompletion: Moya.Completion = { result in + if self.trackInflights { + self.inflightRequests[endpoint]?.forEach { $0(result) } + + objc_sync_enter(self) + self.inflightRequests.removeValue(forKey: endpoint) + objc_sync_exit(self) + } else { + pluginsWithCompletion(result) + } + } + + cancellableToken.innerCancellable = self.performRequest(target, request: preparedRequest, callbackQueue: callbackQueue, progress: progress, completion: networkCompletion, endpoint: endpoint, stubBehavior: stubBehavior) + } + + requestClosure(endpoint, performNetworking) + + return cancellableToken + } + + // swiftlint:disable:next function_parameter_count + private func performRequest(_ target: Target, request: URLRequest, callbackQueue: DispatchQueue?, progress: Moya.ProgressBlock?, completion: @escaping Moya.Completion, endpoint: Endpoint, stubBehavior: Moya.StubBehavior) -> Cancellable { + switch stubBehavior { + case .never: + switch target.task { + case .requestPlain, .requestData, .requestJSONEncodable, .requestParameters, .requestCompositeData, .requestCompositeParameters: + return self.sendRequest(target, request: request, callbackQueue: callbackQueue, progress: progress, completion: completion) + case .uploadFile(let file): + return self.sendUploadFile(target, request: request, callbackQueue: callbackQueue, file: file, progress: progress, completion: completion) + case .uploadMultipart(let multipartBody), .uploadCompositeMultipart(let multipartBody, _): + guard !multipartBody.isEmpty && target.method.supportsMultipart else { + fatalError("\(target) is not a multipart upload target.") + } + return self.sendUploadMultipart(target, request: request, callbackQueue: callbackQueue, multipartBody: multipartBody, progress: progress, completion: completion) + case .downloadDestination(let destination), .downloadParameters(_, _, let destination): + return self.sendDownloadRequest(target, request: request, callbackQueue: callbackQueue, destination: destination, progress: progress, completion: completion) + } + default: + return self.stubRequest(target, request: request, callbackQueue: callbackQueue, completion: completion, endpoint: endpoint, stubBehavior: stubBehavior) + } + } + + func cancelCompletion(_ completion: Moya.Completion, target: Target) { + let error = MoyaError.underlying(NSError(domain: NSURLErrorDomain, code: NSURLErrorCancelled, userInfo: nil), nil) + plugins.forEach { $0.didReceive(.failure(error), target: target) } + completion(.failure(error)) + } + + /// Creates a function which, when called, executes the appropriate stubbing behavior for the given parameters. + public final func createStubFunction(_ token: CancellableToken, forTarget target: Target, withCompletion completion: @escaping Moya.Completion, endpoint: Endpoint, plugins: [PluginType], request: URLRequest) -> (() -> Void) { // swiftlint:disable:this function_parameter_count + return { + if token.isCancelled { + self.cancelCompletion(completion, target: target) + return + } + + switch endpoint.sampleResponseClosure() { + case .networkResponse(let statusCode, let data): + let response = Moya.Response(statusCode: statusCode, data: data, request: request, response: nil) + plugins.forEach { $0.didReceive(.success(response), target: target) } + completion(.success(response)) + case .response(let customResponse, let data): + let response = Moya.Response(statusCode: customResponse.statusCode, data: data, request: request, response: customResponse) + plugins.forEach { $0.didReceive(.success(response), target: target) } + completion(.success(response)) + case .networkError(let error): + let error = MoyaError.underlying(error, nil) + plugins.forEach { $0.didReceive(.failure(error), target: target) } + completion(.failure(error)) + } + } + } + + /// Notify all plugins that a stub is about to be performed. You must call this if overriding `stubRequest`. + final func notifyPluginsOfImpendingStub(for request: URLRequest, target: Target) { + let alamoRequest = manager.request(request as URLRequestConvertible) + plugins.forEach { $0.willSend(alamoRequest, target: target) } + alamoRequest.cancel() + } +} + +private extension MoyaProvider { + func sendUploadMultipart(_ target: Target, request: URLRequest, callbackQueue: DispatchQueue?, multipartBody: [MultipartFormData], progress: Moya.ProgressBlock? = nil, completion: @escaping Moya.Completion) -> CancellableWrapper { + let cancellable = CancellableWrapper() + + let multipartFormData: (RequestMultipartFormData) -> Void = { form in + for bodyPart in multipartBody { + switch bodyPart.provider { + case .data(let data): + form.append(data: data, bodyPart: bodyPart) + case .file(let url): + form.append(fileURL: url, bodyPart: bodyPart) + case .stream(let stream, let length): + form.append(stream: stream, length: length, bodyPart: bodyPart) + } + } + } + + manager.upload(multipartFormData: multipartFormData, with: request) { result in + switch result { + case .success(let alamoRequest, _, _): + if cancellable.isCancelled { + self.cancelCompletion(completion, target: target) + return + } + cancellable.innerCancellable = self.sendAlamofireRequest(alamoRequest, target: target, callbackQueue: callbackQueue, progress: progress, completion: completion) + case .failure(let error): + completion(.failure(MoyaError.underlying(error as NSError, nil))) + } + } + + return cancellable + } + + func sendUploadFile(_ target: Target, request: URLRequest, callbackQueue: DispatchQueue?, file: URL, progress: ProgressBlock? = nil, completion: @escaping Completion) -> CancellableToken { + let uploadRequest = manager.upload(file, with: request) + let alamoRequest = target.validate ? uploadRequest.validate() : uploadRequest + return self.sendAlamofireRequest(alamoRequest, target: target, callbackQueue: callbackQueue, progress: progress, completion: completion) + } + + func sendDownloadRequest(_ target: Target, request: URLRequest, callbackQueue: DispatchQueue?, destination: @escaping DownloadDestination, progress: ProgressBlock? = nil, completion: @escaping Completion) -> CancellableToken { + let downloadRequest = manager.download(request, to: destination) + let alamoRequest = target.validate ? downloadRequest.validate() : downloadRequest + return self.sendAlamofireRequest(alamoRequest, target: target, callbackQueue: callbackQueue, progress: progress, completion: completion) + } + + func sendRequest(_ target: Target, request: URLRequest, callbackQueue: DispatchQueue?, progress: Moya.ProgressBlock?, completion: @escaping Moya.Completion) -> CancellableToken { + let initialRequest = manager.request(request as URLRequestConvertible) + let alamoRequest = target.validate ? initialRequest.validate() : initialRequest + return sendAlamofireRequest(alamoRequest, target: target, callbackQueue: callbackQueue, progress: progress, completion: completion) + } + + // swiftlint:disable:next cyclomatic_complexity + func sendAlamofireRequest(_ alamoRequest: T, target: Target, callbackQueue: DispatchQueue?, progress progressCompletion: Moya.ProgressBlock?, completion: @escaping Moya.Completion) -> CancellableToken where T: Requestable, T: Request { + // Give plugins the chance to alter the outgoing request + let plugins = self.plugins + plugins.forEach { $0.willSend(alamoRequest, target: target) } + + var progressAlamoRequest = alamoRequest + let progressClosure: (Progress) -> Void = { progress in + let sendProgress: () -> Void = { + progressCompletion?(ProgressResponse(progress: progress)) + } + + if let callbackQueue = callbackQueue { + callbackQueue.async(execute: sendProgress) + } else { + sendProgress() + } + } + + // Perform the actual request + if progressCompletion != nil { + switch progressAlamoRequest { + case let downloadRequest as DownloadRequest: + if let downloadRequest = downloadRequest.downloadProgress(closure: progressClosure) as? T { + progressAlamoRequest = downloadRequest + } + case let uploadRequest as UploadRequest: + if let uploadRequest = uploadRequest.uploadProgress(closure: progressClosure) as? T { + progressAlamoRequest = uploadRequest + } + case let dataRequest as DataRequest: + if let dataRequest = dataRequest.downloadProgress(closure: progressClosure) as? T { + progressAlamoRequest = dataRequest + } + default: break + } + } + + let completionHandler: RequestableCompletion = { response, request, data, error in + let result = convertResponseToResult(response, request: request, data: data, error: error) + // Inform all plugins about the response + plugins.forEach { $0.didReceive(result, target: target) } + if let progressCompletion = progressCompletion { + switch progressAlamoRequest { + case let downloadRequest as DownloadRequest: + progressCompletion(ProgressResponse(progress: downloadRequest.progress, response: result.value)) + case let uploadRequest as UploadRequest: + progressCompletion(ProgressResponse(progress: uploadRequest.uploadProgress, response: result.value)) + case let dataRequest as DataRequest: + progressCompletion(ProgressResponse(progress: dataRequest.progress, response: result.value)) + default: + progressCompletion(ProgressResponse(response: result.value)) + } + } + completion(result) + } + + progressAlamoRequest = progressAlamoRequest.response(callbackQueue: callbackQueue, completionHandler: completionHandler) + + progressAlamoRequest.resume() + + return CancellableToken(request: progressAlamoRequest) + } +} diff --git a/client/Pods/Moya/Sources/Moya/MoyaProvider.swift b/client/Pods/Moya/Sources/Moya/MoyaProvider.swift new file mode 100755 index 00000000..fe15d05b --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/MoyaProvider.swift @@ -0,0 +1,182 @@ +import Foundation +import Result + +/// Closure to be executed when a request has completed. +public typealias Completion = (_ result: Result) -> Void + +/// Closure to be executed when progress changes. +public typealias ProgressBlock = (_ progress: ProgressResponse) -> Void + +public struct ProgressResponse { + public let response: Response? + public let progressObject: Progress? + + public init(progress: Progress? = nil, response: Response? = nil) { + self.progressObject = progress + self.response = response + } + + public var progress: Double { + return progressObject?.fractionCompleted ?? 1.0 + } + + public var completed: Bool { + return progress == 1.0 && response != nil + } +} + +public protocol MoyaProviderType: class { + associatedtype Target: TargetType + + func request(_ target: Target, callbackQueue: DispatchQueue?, progress: Moya.ProgressBlock?, completion: @escaping Moya.Completion) -> Cancellable +} + +/// Request provider class. Requests should be made through this class only. +open class MoyaProvider: MoyaProviderType { + + /// Closure that defines the endpoints for the provider. + public typealias EndpointClosure = (Target) -> Endpoint + + /// Closure that decides if and what request should be performed + public typealias RequestResultClosure = (Result) -> Void + + /// Closure that resolves an `Endpoint` into a `RequestResult`. + public typealias RequestClosure = (Endpoint, @escaping RequestResultClosure) -> Void + + /// Closure that decides if/how a request should be stubbed. + public typealias StubClosure = (Target) -> Moya.StubBehavior + + open let endpointClosure: EndpointClosure + open let requestClosure: RequestClosure + open let stubClosure: StubClosure + open let manager: Manager + + /// A list of plugins + /// e.g. for logging, network activity indicator or credentials + open let plugins: [PluginType] + + open let trackInflights: Bool + + open internal(set) var inflightRequests: [Endpoint: [Moya.Completion]] = [:] + + /// Propagated to Alamofire as callback queue. If nil - the Alamofire default (as of their API in 2017 - the main queue) will be used. + let callbackQueue: DispatchQueue? + + /// Initializes a provider. + public init(endpointClosure: @escaping EndpointClosure = MoyaProvider.defaultEndpointMapping, + requestClosure: @escaping RequestClosure = MoyaProvider.defaultRequestMapping, + stubClosure: @escaping StubClosure = MoyaProvider.neverStub, + callbackQueue: DispatchQueue? = nil, + manager: Manager = MoyaProvider.defaultAlamofireManager(), + plugins: [PluginType] = [], + trackInflights: Bool = false) { + + self.endpointClosure = endpointClosure + self.requestClosure = requestClosure + self.stubClosure = stubClosure + self.manager = manager + self.plugins = plugins + self.trackInflights = trackInflights + self.callbackQueue = callbackQueue + } + + /// Returns an `Endpoint` based on the token, method, and parameters by invoking the `endpointClosure`. + open func endpoint(_ token: Target) -> Endpoint { + return endpointClosure(token) + } + + /// Designated request-making method. Returns a `Cancellable` token to cancel the request later. + @discardableResult + open func request(_ target: Target, + callbackQueue: DispatchQueue? = .none, + progress: ProgressBlock? = .none, + completion: @escaping Completion) -> Cancellable { + + let callbackQueue = callbackQueue ?? self.callbackQueue + return requestNormal(target, callbackQueue: callbackQueue, progress: progress, completion: completion) + } + + // swiftlint:disable function_parameter_count + /// When overriding this method, take care to `notifyPluginsOfImpendingStub` and to perform the stub using the `createStubFunction` method. + /// Note: this was previously in an extension, however it must be in the original class declaration to allow subclasses to override. + @discardableResult + open func stubRequest(_ target: Target, request: URLRequest, callbackQueue: DispatchQueue?, completion: @escaping Moya.Completion, endpoint: Endpoint, stubBehavior: Moya.StubBehavior) -> CancellableToken { + let callbackQueue = callbackQueue ?? self.callbackQueue + let cancellableToken = CancellableToken { } + notifyPluginsOfImpendingStub(for: request, target: target) + let plugins = self.plugins + let stub: () -> Void = createStubFunction(cancellableToken, forTarget: target, withCompletion: completion, endpoint: endpoint, plugins: plugins, request: request) + switch stubBehavior { + case .immediate: + switch callbackQueue { + case .none: + stub() + case .some(let callbackQueue): + callbackQueue.async(execute: stub) + } + case .delayed(let delay): + let killTimeOffset = Int64(CDouble(delay) * CDouble(NSEC_PER_SEC)) + let killTime = DispatchTime.now() + Double(killTimeOffset) / Double(NSEC_PER_SEC) + (callbackQueue ?? DispatchQueue.main).asyncAfter(deadline: killTime) { + stub() + } + case .never: + fatalError("Method called to stub request when stubbing is disabled.") + } + + return cancellableToken + } + // swiftlint:enable function_parameter_count +} + +/// Mark: Stubbing + +/// Controls how stub responses are returned. +public enum StubBehavior { + + /// Do not stub. + case never + + /// Return a response immediately. + case immediate + + /// Return a response after a delay. + case delayed(seconds: TimeInterval) +} + +public extension MoyaProvider { + + // Swift won't let us put the StubBehavior enum inside the provider class, so we'll + // at least add some class functions to allow easy access to common stubbing closures. + + public final class func neverStub(_: Target) -> Moya.StubBehavior { + return .never + } + + public final class func immediatelyStub(_: Target) -> Moya.StubBehavior { + return .immediate + } + + public final class func delayedStub(_ seconds: TimeInterval) -> (Target) -> Moya.StubBehavior { + return { _ in return .delayed(seconds: seconds) } + } +} + +public func convertResponseToResult(_ response: HTTPURLResponse?, request: URLRequest?, data: Data?, error: Swift.Error?) -> + Result { + switch (response, data, error) { + case let (.some(response), data, .none): + let response = Moya.Response(statusCode: response.statusCode, data: data ?? Data(), request: request, response: response) + return .success(response) + case let (.some(response), _, .some(error)): + let response = Moya.Response(statusCode: response.statusCode, data: data ?? Data(), request: request, response: response) + let error = MoyaError.underlying(error, response) + return .failure(error) + case let (_, _, .some(error)): + let error = MoyaError.underlying(error, nil) + return .failure(error) + default: + let error = MoyaError.underlying(NSError(domain: NSURLErrorDomain, code: NSURLErrorUnknown, userInfo: nil), nil) + return .failure(error) + } +} diff --git a/client/Pods/Moya/Sources/Moya/MultiTarget.swift b/client/Pods/Moya/Sources/Moya/MultiTarget.swift new file mode 100644 index 00000000..9b0ad562 --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/MultiTarget.swift @@ -0,0 +1,46 @@ +import Foundation + +/// A `TargetType` used to enable `MoyaProvider` to process multiple `TargetType`s. +public enum MultiTarget: TargetType { + /// The embedded `TargetType`. + case target(TargetType) + + public init(_ target: TargetType) { + self = MultiTarget.target(target) + } + + public var path: String { + return target.path + } + + public var baseURL: URL { + return target.baseURL + } + + public var method: Moya.Method { + return target.method + } + + public var sampleData: Data { + return target.sampleData + } + + public var task: Task { + return target.task + } + + public var validate: Bool { + return target.validate + } + + public var headers: [String: String]? { + return target.headers + } + + /// The embedded `TargetType`. + public var target: TargetType { + switch self { + case .target(let t): return t + } + } +} diff --git a/client/Pods/Moya/Sources/Moya/MultipartFormData.swift b/client/Pods/Moya/Sources/Moya/MultipartFormData.swift new file mode 100644 index 00000000..1afd020c --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/MultipartFormData.swift @@ -0,0 +1,59 @@ +import Foundation + +/// Represents "multipart/form-data" for an upload. +public struct MultipartFormData { + + /// Method to provide the form data. + public enum FormDataProvider { + case data(Foundation.Data) + case file(URL) + case stream(InputStream, UInt64) + } + + /// Initialize a new `MultipartFormData`. + public init(provider: FormDataProvider, name: String, fileName: String? = nil, mimeType: String? = nil) { + self.provider = provider + self.name = name + self.fileName = fileName + self.mimeType = mimeType + } + + /// The method being used for providing form data. + public let provider: FormDataProvider + + /// The name. + public let name: String + + /// The file name. + public let fileName: String? + + /// The MIME type + public let mimeType: String? +} + +// MARK: RequestMultipartFormData appending +internal extension RequestMultipartFormData { + func append(data: Data, bodyPart: MultipartFormData) { + if let mimeType = bodyPart.mimeType { + if let fileName = bodyPart.fileName { + append(data, withName: bodyPart.name, fileName: fileName, mimeType: mimeType) + } else { + append(data, withName: bodyPart.name, mimeType: mimeType) + } + } else { + append(data, withName: bodyPart.name) + } + } + + func append(fileURL url: URL, bodyPart: MultipartFormData) { + if let fileName = bodyPart.fileName, let mimeType = bodyPart.mimeType { + append(url, withName: bodyPart.name, fileName: fileName, mimeType: mimeType) + } else { + append(url, withName: bodyPart.name) + } + } + + func append(stream: InputStream, length: UInt64, bodyPart: MultipartFormData) { + append(stream, withLength: length, name: bodyPart.name, fileName: bodyPart.fileName ?? "", mimeType: bodyPart.mimeType ?? "") + } +} diff --git a/client/Pods/Moya/Sources/Moya/Plugin.swift b/client/Pods/Moya/Sources/Moya/Plugin.swift new file mode 100644 index 00000000..a870668b --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/Plugin.swift @@ -0,0 +1,47 @@ +import Foundation +import Result + +/// A Moya Plugin receives callbacks to perform side effects wherever a request is sent or received. +/// +/// for example, a plugin may be used to +/// - log network requests +/// - hide and show a network activity indicator +/// - inject additional information into a request +public protocol PluginType { + /// Called to modify a request before sending + func prepare(_ request: URLRequest, target: TargetType) -> URLRequest + + /// Called immediately before a request is sent over the network (or stubbed). + func willSend(_ request: RequestType, target: TargetType) + + /// Called after a response has been received, but before the MoyaProvider has invoked its completion handler. + func didReceive(_ result: Result, target: TargetType) + + /// Called to modify a result before completion + func process(_ result: Result, target: TargetType) -> Result +} + +public extension PluginType { + func prepare(_ request: URLRequest, target: TargetType) -> URLRequest { return request } + func willSend(_ request: RequestType, target: TargetType) { } + func didReceive(_ result: Result, target: TargetType) { } + func process(_ result: Result, target: TargetType) -> Result { return result } +} + +/// Request type used by `willSend` plugin function. +public protocol RequestType { + + // Note: + // + // We use this protocol instead of the Alamofire request to avoid leaking that abstraction. + // A plugin should not know about Alamofire at all. + + /// Retrieve an `NSURLRequest` representation. + var request: URLRequest? { get } + + /// Authenticates the request with a username and password. + func authenticate(user: String, password: String, persistence: URLCredential.Persistence) -> Self + + /// Authenticates the request with an `NSURLCredential` instance. + func authenticate(usingCredential credential: URLCredential) -> Self +} diff --git a/client/Pods/Moya/Sources/Moya/Plugins/AccessTokenPlugin.swift b/client/Pods/Moya/Sources/Moya/Plugins/AccessTokenPlugin.swift new file mode 100644 index 00000000..4bfa3fad --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/Plugins/AccessTokenPlugin.swift @@ -0,0 +1,73 @@ +import Foundation +import Result + +// MARK: - AccessTokenAuthorizable + +/// A protocol for controlling the behavior of `AccessTokenPlugin`. +public protocol AccessTokenAuthorizable { + + /// Represents the authorization header to use for requests. + var authorizationType: AuthorizationType { get } +} + +// MARK: - AuthorizationType + +/// An enum representing the header to use with an `AccessTokenPlugin` +public enum AuthorizationType: String { + case none + case basic = "Basic" + case bearer = "Bearer" +} + +// MARK: - AccessTokenPlugin + +/** + A plugin for adding basic or bearer-type authorization headers to requests. Example: + + ``` + Authorization: Bearer + Authorization: Basic + ``` + +*/ +public struct AccessTokenPlugin: PluginType { + + /// A closure returning the access token to be applied in the header. + public let tokenClosure: () -> String + + /** + Initialize a new `AccessTokenPlugin`. + + - parameters: + - tokenClosure: A closure returning the token to be applied in the pattern `Authorization: ` + */ + public init(tokenClosure: @escaping @autoclosure () -> String) { + self.tokenClosure = tokenClosure + } + + /** + Prepare a request by adding an authorization header if necessary. + + - parameters: + - request: The request to modify. + - target: The target of the request. + - returns: The modified `URLRequest`. + */ + public func prepare(_ request: URLRequest, target: TargetType) -> URLRequest { + guard let authorizable = target as? AccessTokenAuthorizable else { return request } + + let authorizationType = authorizable.authorizationType + + var request = request + + switch authorizationType { + case .basic, .bearer: + let authValue = authorizationType.rawValue + " " + tokenClosure() + request.addValue(authValue, forHTTPHeaderField: "Authorization") + case .none: + break + } + + return request + } +} diff --git a/client/Pods/Moya/Sources/Moya/Plugins/CredentialsPlugin.swift b/client/Pods/Moya/Sources/Moya/Plugins/CredentialsPlugin.swift new file mode 100644 index 00000000..9e2042ac --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/Plugins/CredentialsPlugin.swift @@ -0,0 +1,21 @@ +import Foundation +import Result + +/// Provides each request with optional URLCredentials. +public final class CredentialsPlugin: PluginType { + + public typealias CredentialClosure = (TargetType) -> URLCredential? + let credentialsClosure: CredentialClosure + + public init(credentialsClosure: @escaping CredentialClosure) { + self.credentialsClosure = credentialsClosure + } + + // MARK: Plugin + + public func willSend(_ request: RequestType, target: TargetType) { + if let credentials = credentialsClosure(target) { + _ = request.authenticate(usingCredential: credentials) + } + } +} diff --git a/client/Pods/Moya/Sources/Moya/Plugins/NetworkActivityPlugin.swift b/client/Pods/Moya/Sources/Moya/Plugins/NetworkActivityPlugin.swift new file mode 100644 index 00000000..50700bc2 --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/Plugins/NetworkActivityPlugin.swift @@ -0,0 +1,30 @@ +import Foundation +import Result + +/// Network activity change notification type. +public enum NetworkActivityChangeType { + case began, ended +} + +/// Notify a request's network activity changes (request begins or ends). +public final class NetworkActivityPlugin: PluginType { + + public typealias NetworkActivityClosure = (_ change: NetworkActivityChangeType, _ target: TargetType) -> Void + let networkActivityClosure: NetworkActivityClosure + + public init(networkActivityClosure: @escaping NetworkActivityClosure) { + self.networkActivityClosure = networkActivityClosure + } + + // MARK: Plugin + + /// Called by the provider as soon as the request is about to start + public func willSend(_ request: RequestType, target: TargetType) { + networkActivityClosure(.began, target) + } + + /// Called by the provider as soon as a response arrives, even if the request is canceled. + public func didReceive(_ result: Result, target: TargetType) { + networkActivityClosure(.ended, target) + } +} diff --git a/client/Pods/Moya/Sources/Moya/Plugins/NetworkLoggerPlugin.swift b/client/Pods/Moya/Sources/Moya/Plugins/NetworkLoggerPlugin.swift new file mode 100644 index 00000000..3457c4ea --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/Plugins/NetworkLoggerPlugin.swift @@ -0,0 +1,113 @@ +import Foundation +import Result + +/// Logs network activity (outgoing requests and incoming responses). +public final class NetworkLoggerPlugin: PluginType { + fileprivate let loggerId = "Moya_Logger" + fileprivate let dateFormatString = "dd/MM/yyyy HH:mm:ss" + fileprivate let dateFormatter = DateFormatter() + fileprivate let separator = ", " + fileprivate let terminator = "\n" + fileprivate let cURLTerminator = "\\\n" + fileprivate let output: (_ separator: String, _ terminator: String, _ items: Any...) -> Void + fileprivate let requestDataFormatter: ((Data) -> (String))? + fileprivate let responseDataFormatter: ((Data) -> (Data))? + + /// If true, also logs response body data. + public let isVerbose: Bool + public let cURL: Bool + + public init(verbose: Bool = false, cURL: Bool = false, output: ((_ separator: String, _ terminator: String, _ items: Any...) -> Void)? = nil, requestDataFormatter: ((Data) -> (String))? = nil, responseDataFormatter: ((Data) -> (Data))? = nil) { + self.cURL = cURL + self.isVerbose = verbose + self.output = output ?? NetworkLoggerPlugin.reversedPrint + self.requestDataFormatter = requestDataFormatter + self.responseDataFormatter = responseDataFormatter + } + + public func willSend(_ request: RequestType, target: TargetType) { + if let request = request as? CustomDebugStringConvertible, cURL { + output(separator, terminator, request.debugDescription) + return + } + outputItems(logNetworkRequest(request.request as URLRequest?)) + } + + public func didReceive(_ result: Result, target: TargetType) { + if case .success(let response) = result { + outputItems(logNetworkResponse(response.response, data: response.data, target: target)) + } else { + outputItems(logNetworkResponse(nil, data: nil, target: target)) + } + } + + fileprivate func outputItems(_ items: [String]) { + if isVerbose { + items.forEach { output(separator, terminator, $0) } + } else { + output(separator, terminator, items) + } + } +} + +private extension NetworkLoggerPlugin { + + var date: String { + dateFormatter.dateFormat = dateFormatString + dateFormatter.locale = Locale(identifier: "en_US_POSIX") + return dateFormatter.string(from: Date()) + } + + func format(_ loggerId: String, date: String, identifier: String, message: String) -> String { + return "\(loggerId): [\(date)] \(identifier): \(message)" + } + + func logNetworkRequest(_ request: URLRequest?) -> [String] { + + var output = [String]() + + output += [format(loggerId, date: date, identifier: "Request", message: request?.description ?? "(invalid request)")] + + if let headers = request?.allHTTPHeaderFields { + output += [format(loggerId, date: date, identifier: "Request Headers", message: headers.description)] + } + + if let bodyStream = request?.httpBodyStream { + output += [format(loggerId, date: date, identifier: "Request Body Stream", message: bodyStream.description)] + } + + if let httpMethod = request?.httpMethod { + output += [format(loggerId, date: date, identifier: "HTTP Request Method", message: httpMethod)] + } + + if let body = request?.httpBody, let stringOutput = requestDataFormatter?(body) ?? String(data: body, encoding: .utf8), isVerbose { + output += [format(loggerId, date: date, identifier: "Request Body", message: stringOutput)] + } + + return output + } + + func logNetworkResponse(_ response: HTTPURLResponse?, data: Data?, target: TargetType) -> [String] { + guard let response = response else { + return [format(loggerId, date: date, identifier: "Response", message: "Received empty network response for \(target).")] + } + + var output = [String]() + + output += [format(loggerId, date: date, identifier: "Response", message: response.description)] + + if let data = data, let stringData = String(data: responseDataFormatter?(data) ?? data, encoding: String.Encoding.utf8), isVerbose { + output += [stringData] + } + + return output + } +} + +fileprivate extension NetworkLoggerPlugin { + static func reversedPrint(_ separator: String, terminator: String, items: Any...) { + for item in items { + print(item, separator: separator, terminator: terminator) + } + } +} diff --git a/client/Pods/Moya/Sources/Moya/Response.swift b/client/Pods/Moya/Sources/Moya/Response.swift new file mode 100644 index 00000000..a6c60d9d --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/Response.swift @@ -0,0 +1,144 @@ +import Foundation + +/// Represents a response to a `MoyaProvider.request`. +public final class Response: CustomDebugStringConvertible, Equatable { + public let statusCode: Int + public let data: Data + public let request: URLRequest? + public let response: HTTPURLResponse? + + /// Initialize a new `Response`. + public init(statusCode: Int, data: Data, request: URLRequest? = nil, response: HTTPURLResponse? = nil) { + self.statusCode = statusCode + self.data = data + self.request = request + self.response = response + } + + /// A text description of the `Response`. + public var description: String { + return "Status Code: \(statusCode), Data Length: \(data.count)" + } + + /// A text description of the `Response`. Suitable for debugging. + public var debugDescription: String { + return description + } + + public static func == (lhs: Response, rhs: Response) -> Bool { + return lhs.statusCode == rhs.statusCode + && lhs.data == rhs.data + && lhs.response == rhs.response + } +} + +public extension Response { + + /** + Returns the `Response` if the `statusCode` falls within the specified range. + + - parameters: + - statusCodes: The range of acceptable status codes. + - throws: `MoyaError.statusCode` when others are encountered. + */ + public func filter(statusCodes: ClosedRange) throws -> Response { + guard statusCodes.contains(statusCode) else { + throw MoyaError.statusCode(self) + } + return self + } + + /** + Returns the `Response` if it has the specified `statusCode`. + + - parameters: + - statusCode: The acceptable status code. + - throws: `MoyaError.statusCode` when others are encountered. + */ + public func filter(statusCode: Int) throws -> Response { + return try filter(statusCodes: statusCode...statusCode) + } + + /** + Returns the `Response` if the `statusCode` falls within the range 200 - 299. + + - throws: `MoyaError.statusCode` when others are encountered. + */ + public func filterSuccessfulStatusCodes() throws -> Response { + return try filter(statusCodes: 200...299) + } + + /** + Returns the `Response` if the `statusCode` falls within the range 200 - 399. + + - throws: `MoyaError.statusCode` when others are encountered. + */ + public func filterSuccessfulStatusAndRedirectCodes() throws -> Response { + return try filter(statusCodes: 200...399) + } + + /// Maps data received from the signal into a UIImage. + func mapImage() throws -> Image { + guard let image = Image(data: data) else { + throw MoyaError.imageMapping(self) + } + return image + } + + /// Maps data received from the signal into a JSON object. + func mapJSON(failsOnEmptyData: Bool = true) throws -> Any { + do { + return try JSONSerialization.jsonObject(with: data, options: .allowFragments) + } catch { + if data.count < 1 && !failsOnEmptyData { + return NSNull() + } + throw MoyaError.jsonMapping(self) + } + } + + /// Maps data received from the signal into a String. + /// + /// - parameter atKeyPath: Optional key path at which to parse string. + public func mapString(atKeyPath keyPath: String? = nil) throws -> String { + if let keyPath = keyPath { + // Key path was provided, try to parse string at key path + guard let jsonDictionary = try mapJSON() as? NSDictionary, + let string = jsonDictionary.value(forKeyPath: keyPath) as? String else { + throw MoyaError.stringMapping(self) + } + return string + } else { + // Key path was not provided, parse entire response as string + guard let string = String(data: data, encoding: .utf8) else { + throw MoyaError.stringMapping(self) + } + return string + } + } + + /// Maps data received from the signal into a Decodable object. + /// + /// - parameter atKeyPath: Optional key path at which to parse object. + /// - parameter using: A `JSONDecoder` instance which is used to decode data to an object. + func map(_ type: D.Type, atKeyPath keyPath: String? = nil, using decoder: JSONDecoder = JSONDecoder()) throws -> D { + let jsonData: Data + if let keyPath = keyPath { + guard let jsonObject = (try mapJSON() as? NSDictionary)?.value(forKeyPath: keyPath) else { + throw MoyaError.jsonMapping(self) + } + do { + jsonData = try JSONSerialization.data(withJSONObject: jsonObject) + } catch { + throw MoyaError.jsonMapping(self) + } + } else { + jsonData = data + } + do { + return try decoder.decode(D.self, from: jsonData) + } catch let error { + throw MoyaError.objectMapping(error, self) + } + } +} diff --git a/client/Pods/Moya/Sources/Moya/TargetType.swift b/client/Pods/Moya/Sources/Moya/TargetType.swift new file mode 100644 index 00000000..7302d1fe --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/TargetType.swift @@ -0,0 +1,32 @@ +import Foundation + +/// The protocol used to define the specifications necessary for a `MoyaProvider`. +public protocol TargetType { + + /// The target's base `URL`. + var baseURL: URL { get } + + /// The path to be appended to `baseURL` to form the full `URL`. + var path: String { get } + + /// The HTTP method used in the request. + var method: Moya.Method { get } + + /// Provides stub data for use in testing. + var sampleData: Data { get } + + /// The type of HTTP task to be performed. + var task: Task { get } + + /// Whether or not to perform Alamofire validation. Defaults to `false`. + var validate: Bool { get } + + /// The headers to be used in the request. + var headers: [String: String]? { get } +} + +public extension TargetType { + var validate: Bool { + return false + } +} diff --git a/client/Pods/Moya/Sources/Moya/Task.swift b/client/Pods/Moya/Sources/Moya/Task.swift new file mode 100644 index 00000000..9f9e6d09 --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/Task.swift @@ -0,0 +1,38 @@ +import Foundation + +/// Represents an HTTP task. +public enum Task { + + /// A request with no additional data. + case requestPlain + + /// A requests body set with data. + case requestData(Data) + + /// A request body set with `Encodable` type + case requestJSONEncodable(Encodable) + + /// A requests body set with encoded parameters. + case requestParameters(parameters: [String: Any], encoding: ParameterEncoding) + + /// A requests body set with data, combined with url parameters. + case requestCompositeData(bodyData: Data, urlParameters: [String: Any]) + + /// A requests body set with encoded parameters combined with url parameters. + case requestCompositeParameters(bodyParameters: [String: Any], bodyEncoding: ParameterEncoding, urlParameters: [String: Any]) + + /// A file upload task. + case uploadFile(URL) + + /// A "multipart/form-data" upload task. + case uploadMultipart([MultipartFormData]) + + /// A "multipart/form-data" upload task combined with url parameters. + case uploadCompositeMultipart([MultipartFormData], urlParameters: [String: Any]) + + /// A file download task to a destination. + case downloadDestination(DownloadDestination) + + /// A file download task to a destination with extra parameters using the given encoding. + case downloadParameters(parameters: [String: Any], encoding: ParameterEncoding, destination: DownloadDestination) +} diff --git a/client/Pods/Moya/Sources/Moya/URL+Moya.swift b/client/Pods/Moya/Sources/Moya/URL+Moya.swift new file mode 100644 index 00000000..9351fa43 --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/URL+Moya.swift @@ -0,0 +1,16 @@ +import Foundation + +public extension URL { + + /// Initialize URL from Moya's `TargetType`. + init(target: T) { + // When a TargetType's path is empty, URL.appendingPathComponent may introduce trailing /, which may not be wanted in some cases + // See: https://github.com/Moya/Moya/pull/1053 + // And: https://github.com/Moya/Moya/issues/1049 + if target.path.isEmpty { + self = target.baseURL + } else { + self = target.baseURL.appendingPathComponent(target.path) + } + } +} diff --git a/client/Pods/Moya/Sources/Moya/URLRequest+Encoding.swift b/client/Pods/Moya/Sources/Moya/URLRequest+Encoding.swift new file mode 100644 index 00000000..74c84b78 --- /dev/null +++ b/client/Pods/Moya/Sources/Moya/URLRequest+Encoding.swift @@ -0,0 +1,22 @@ +import Foundation + +internal extension URLRequest { + + mutating func encoded(encodable: Encodable) throws -> URLRequest { + do { + let encodable = AnyEncodable(encodable) + httpBody = try JSONEncoder().encode(encodable) + return self + } catch { + throw MoyaError.encodableMapping(error) + } + } + + func encoded(parameters: [String: Any], parameterEncoding: ParameterEncoding) throws -> URLRequest { + do { + return try parameterEncoding.encode(self, with: parameters) + } catch { + throw MoyaError.parameterEncoding(error) + } + } +} diff --git a/client/Pods/Pods.xcodeproj/project.pbxproj b/client/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 00000000..738dc2c8 --- /dev/null +++ b/client/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,2227 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 00C739C3F6233D1BE35BD0060F24F461 /* NSImage+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 28F5CBA5D57145670252BA3210EBF36D /* NSImage+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 03905D0FD58E772457B809C9443B9633 /* NetworkActivityPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA217455517D00B368E78F5CE61C7557 /* NetworkActivityPlugin.swift */; }; + 068EE77B364B309A5973AA63DCE763D0 /* Endpoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2AC5D810FFEB6B0751717477D7232FC /* Endpoint.swift */; }; + 0BD671A679D3133E70056CF98DE7E67F /* SDWebImagePrefetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = D58F2CC65342BD04AD0B54743D21BB65 /* SDWebImagePrefetcher.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10CF2B0CC428F0F1AB459273EDA051A6 /* SDWebImageGIFCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F0B01DDD5246235FB73D954AA6F165E /* SDWebImageGIFCoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA305C4B4618727464B60E2254E7A481 /* Timeline.swift */; }; + 134061121AC1A0F4F69760136A04A01C /* SDWebImageImageIOCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 794D9CDCE82A555D17430B96BF9B59EA /* SDWebImageImageIOCoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 14955A2D5AA442C34121589CE5D0BC7D /* UIView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 60F3F22E9389B63ACD38EA946CE51873 /* UIView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 16E65053553C8459DB864ACCC6B7F6F1 /* SDWebImageDownloaderOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 07CB6B6EE1C9CD5B1E1792DF2C3F9498 /* SDWebImageDownloaderOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1888D03C6000539D1BDE17A87FD2994B /* SDWebImageCoderHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 25DEB570E8FB8E9F612DC1165A3B3CE4 /* SDWebImageCoderHelper.m */; }; + 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 61CD5C7B22EC023AA2A57765712925E2 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 24065029085002EAC70A3422A7D39EC1 /* FontAwesome.swift-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = D7F83C85ABDEBB6A3468A3361248B697 /* FontAwesome.swift-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 240E2DC68715A5DC24601252620CB11D /* SDWebImageCompat.m in Sources */ = {isa = PBXBuildFile; fileRef = 831E0490B13599D827435929CD1F1AD4 /* SDWebImageCompat.m */; }; + 2641C5F2AF734454E8A6DF94E606EE71 /* MoyaError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22F55A6EB0DB0A600D4AB6E75AF354D9 /* MoyaError.swift */; }; + 28CF43A5F393209DAC203A70606FF313 /* UIButton+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E205DFEC1178A9729B6EB6977683D259 /* UIButton+WebCache.m */; }; + 2968F27F99F394EABFF42645167C47A7 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = A38CC73A50C48C605004C3B4972C8554 /* Response.swift */; }; + 29E3E7618147D1C05CFA6ACCC941792C /* Pods-CoolCardsIntegrationTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CE620962D57ED460AAEDD36FCBB444D /* Pods-CoolCardsIntegrationTests-dummy.m */; }; + 2AE0F58A0988D92438C1448C861A154C /* FontAwesomeImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C25AFEF01D8BB214D55A4D6FB799557 /* FontAwesomeImageView.swift */; }; + 2D28363017E4B05CC994BE054C59C4C7 /* SDImageCacheConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 59F50A08C09D782B7BA7B7431473EABA /* SDImageCacheConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3433BF7613AB168C91A7310C0B5CE6A9 /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45572E2B06D86E4E6E3DD5F9AD204019 /* MultipartFormData.swift */; }; + 359886A1AD98AC0CA4C60D9C1E74219E /* SDWebImageImageIOCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 172424BD80FDB52E9E019698F4FEDAAD /* SDWebImageImageIOCoder.m */; }; + 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2FE1BBF9A1763FEEC49280AB0B25020 /* TaskDelegate.swift */; }; + 36C33EC0952D217038E06134251A4267 /* NetworkLoggerPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F9DE532D29285847E9C471C7AEACA02 /* NetworkLoggerPlugin.swift */; }; + 3D1410A3EE9B779EBC857519C3CAE2FB /* NSData+ImageContentType.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC64F849712B9767059DF9F4C375EA0 /* NSData+ImageContentType.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3F706026A035BF032423F0D5DCC7DFD5 /* SDWebImageFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 99544F256105FA1E39FC810696DF42D8 /* SDWebImageFrame.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 41D3D194B0CEFA7E9538D27533CE90E1 /* SDWebImageCoderHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = F7BD919E7C0711C535E386E6F689D263 /* SDWebImageCoderHelper.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 41FAD1CDCD9272883A6CF33FE8FF44E0 /* FontAwesomeSegmentedControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4D139EB9FFA53F0F372CC238008C185 /* FontAwesomeSegmentedControl.swift */; }; + 449AC53127C17B180EE8D1A7AB38C9D6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D57B36DCDFFF88B2CDD89F077E55F825 /* Foundation.framework */; }; + 451F581CB2A373D14D3C5071F7309CA8 /* UIImage+GIF.h in Headers */ = {isa = PBXBuildFile; fileRef = C61B50BAADA97A8E3F3EBC2D47997755 /* UIImage+GIF.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 46517113831036C4DE5608AA51A3AD39 /* SDWebImageDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 6444E9B99E774DC8B9660334EBD41392 /* SDWebImageDownloader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 49E820E70C2D6BDF96BE3BFEF1B5E425 /* Pods-CoolCardsTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = FFC2EB94ECA2AC8FE8C07436E6E56622 /* Pods-CoolCardsTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4A54582B320910433D1A82740A41FAF1 /* MultiTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3294229D029894747E0FAD77874A111 /* MultiTarget.swift */; }; + 4BFBC67C4FDE6B231218020E74794569 /* UIView+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E33D11D852D523B92FCCEB5798407942 /* UIView+WebCache.m */; }; + 4CD83D08679D747C64540BCE78E5B4F6 /* UIImage+MultiFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 692B49BAF7AA6884C674C17C777FEB6E /* UIImage+MultiFormat.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4DB8593B9899B51DEF81B747AC080C1B /* UIView+WebCacheOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CAF193DDD4EBC6614ECD8F6CC3959AB7 /* UIView+WebCacheOperation.m */; }; + 4E8C422389A0AAE287521D8922975C4D /* UIImage+GIF.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1AD09AFA5A0E77A0C74005E4E27683 /* UIImage+GIF.m */; }; + 4EFA908CA9A3E9A800B618AC902F5990 /* FontAwesome.swift.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 705B27D67C07D10518F514F3E00074BB /* FontAwesome.swift.bundle */; }; + 4FE5D28732237858ECB53AC00A9BE612 /* SDWebImageCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = E35CE31C9DF506A33BEDC3CB60EED3FF /* SDWebImageCoder.m */; }; + 522BEF444AEAA78D1747B62ED49C688E /* FontAwesomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39137C391F8E7037BA5532CAE6FF1D04 /* FontAwesomeView.swift */; }; + 52CFE2295A6C897E7B1374DC04C10AFA /* Pods-CoolCardsTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F727C55130407C51E7FDA2FC2B6ACCD /* Pods-CoolCardsTests-dummy.m */; }; + 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 355F7D22A4C0119FC564A9941E6DECBB /* Request.swift */; }; + 5539A3CD2B653BA23D68AED9ADEA40C5 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C7F0894B95289D4D62B7C00D0E70042 /* Alamofire.framework */; }; + 555AABD226E4FCBD91442DE5AED8483A /* Moya-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0869846D716A2AC99425E2C2DEF71615 /* Moya-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 55E6453BBF2B8D9D118BDF68FA13DCA9 /* UIImageView+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = D566FAEAD254D56AFF55C7C949163E59 /* UIImageView+WebCache.m */; }; + 56C0C5474066BD0F8705C8184A519543 /* SDWebImageFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 2626C9670B3E81B4F5AFDBC70E333475 /* SDWebImageFrame.m */; }; + 589D19F8FC8F1E9D6360D950D26A7138 /* FontAwesome.swift in Sources */ = {isa = PBXBuildFile; fileRef = F63A3249E9986E857C2D294DD1347CDE /* FontAwesome.swift */; }; + 59A9411DF178B5173CC1C6F44A3A30A9 /* UIImage+ForceDecode.h in Headers */ = {isa = PBXBuildFile; fileRef = E7FD1B082E2F6A9A492707D1080393AB /* UIImage+ForceDecode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5AD3E160E28F5EFC4D17A8668CA322BD /* FontAwesomeBarButtonItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D023243175198CF7F8CF6FACDC15389 /* FontAwesomeBarButtonItem.swift */; }; + 5B72B69DD603A056FE26772F3CFD56E8 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99DC407584A24C7ADA525FE8423C454C /* Result.framework */; }; + 5BB8EA4A2E5BEAB53FD3C34496F3CEDB /* AnyEncodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDB57F13222E750CE7245CF3BAD23A9A /* AnyEncodable.swift */; }; + 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3373737441A29B65F9B9355B11A3FA64 /* DispatchQueue+Alamofire.swift */; }; + 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2730B80A1BDF8B39A5E3E6C4F46FD917 /* ServerTrustPolicy.swift */; }; + 65690C3941CEECF30D1509B15E3DBB91 /* Pods-CoolCards-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3FF66AB7615EE07EE963904F3A30C6 /* Pods-CoolCards-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 65D01C54FCF24BF6E6FBCD49F6E7CCB1 /* FontAwesomeTabBarItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2103F770B4BF7E0A04F1320BF481A33A /* FontAwesomeTabBarItem.swift */; }; + 684E126B8E890761BBB1A4EB590EA1F3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84ECFF1D57EC8E965A11065F1DFD3B88 /* UIKit.framework */; }; + 6BAE5A1DC9D8A6DED87FF11DEA68C04D /* Cancellable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98E67A888598B721666212341B709BE8 /* Cancellable.swift */; }; + 6CA5E85D6DC8B3A19080CA0519E668D9 /* SDWebImageCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBE5E192B53B87A4156F8797744BCA7 /* SDWebImageCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 71DD71770F915F1621F0155CFD6CCEDD /* ResultProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58029899CE79C109AA85F9585BBDA1C9 /* ResultProtocol.swift */; }; + 72A33533B80375C7B4C5248721137E9C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D57B36DCDFFF88B2CDD89F077E55F825 /* Foundation.framework */; }; + 7306AF75696AC305A1D48CE159A8B545 /* Pods-CoolCards-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D832F5879ECC68387719BC6C039792B /* Pods-CoolCards-dummy.m */; }; + 734DB2FCFAF4D4C5FFCF5D2902EEBB98 /* SDWebImageCodersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = EA09AC42DF351B7F8805AC0108A110D5 /* SDWebImageCodersManager.m */; }; + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D57B36DCDFFF88B2CDD89F077E55F825 /* Foundation.framework */; }; + 795ED1A351690C7143540C8CB7AA6CD0 /* Result-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = B49AD18D66CB685DC71024052EED5F14 /* Result-dummy.m */; }; + 79B3581182D487C5DBEF24D7E8B263BE /* URLRequest+Encoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89007F91BAAC80A51FD1400AE338ACCB /* URLRequest+Encoding.swift */; }; + 7B0FACE97300F45175045FD090F70CE2 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = F92A06C22FB538247E71F27A55D561E1 /* Image.swift */; }; + 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1ACBD588F7DE3BA036BA6456D43C15F /* SessionDelegate.swift */; }; + 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13493708B716141A3E0740B1332606BA /* Result.swift */; }; + 7EB727C4BF3E548C60706E15C861E756 /* UIImageView+HighlightedWebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E13E172C1164FECB45D7CB47A57B0FEB /* UIImageView+HighlightedWebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 839A55AD3279D154DC55C93BE714B93E /* AccessTokenPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2FAC617C2C98681D3B87FF5999AFE58 /* AccessTokenPlugin.swift */; }; + 942AE58D88FFF7FBBC734EF99DC0D767 /* SDWebImageManager.h in Headers */ = {isa = PBXBuildFile; fileRef = B1CC423BAEFE5190F588C4C31FF71EC7 /* SDWebImageManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9ABA0285F3F722A90DA8D5F6BAF68B6F /* SDWebImageOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 470862EF65658761A3276CB3B6ADEF77 /* SDWebImageOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59B75E7B8008F695B68A0452681955AD /* AFError.swift */; }; + A03ADFA996990D2DA836E6FFCEE37F36 /* MoyaProvider+Internal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20CAC952E63234D56A9647302F581D8D /* MoyaProvider+Internal.swift */; }; + A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 917E3B5978E9B2DBACE8159319C66DD7 /* NetworkReachabilityManager.swift */; }; + A2ACDFD0BC4B71542CF335549DD9A893 /* SDWebImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B720B5B768DFA88A1254D2FB45A6EED0 /* SDWebImageManager.m */; }; + A36633C20A13B727FE2F135FB3261A24 /* Result-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BA3775B4FAF8A854BADB9ACFDEC1F6C /* Result-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A46ECAD1FE903ECD9E035F9DB92CCEFE /* URL+Moya.swift in Sources */ = {isa = PBXBuildFile; fileRef = D177CD9C43AE17C38362511779BBBFA6 /* URL+Moya.swift */; }; + A4A7E0E7713372CEF2409C4B6E564837 /* MoyaProvider+Defaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12748B744B6EEE738FA8EB00BC419C5A /* MoyaProvider+Defaults.swift */; }; + A6DFDB95B80BEE907484567462424BE0 /* UIImageView+HighlightedWebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F4932D6C8428C1C3AA7232ACBC636B6 /* UIImageView+HighlightedWebCache.m */; }; + A9CA258A1B6D95AA156B0601E9473EF5 /* TargetType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D53907721A2818751E2565E95CEA9FF /* TargetType.swift */; }; + A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7C2B63ECBBFC8529D28BB928E3730BBC /* Alamofire-dummy.m */; }; + ABB98C54CA069C00FFE05007DBDD84F7 /* SDWebImage-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4208834FDF79B316D2386A8AE0D094E7 /* SDWebImage-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AC312D7710ABC278C80AD5B333158296 /* UIImage+MultiFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E800D5FB1134CF74B43AA7518578CB9 /* UIImage+MultiFormat.m */; }; + AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 076D5AB461A702694703E3EB816090E7 /* SessionManager.swift */; }; + B3D2B497C3F6721D93B9D8C6E459B763 /* Moya+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB16C3ACB1635BC34E5E1A1E27BE9A8B /* Moya+Alamofire.swift */; }; + B45296DABC02FAD49DF7AEA9EC7952F1 /* SDWebImage-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1069F9470D723B06E49D25984BEFFE24 /* SDWebImage-dummy.m */; }; + B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A332514E44620E40EEE26A5A5F26B44 /* MultipartFormData.swift */; }; + B9760E715020DE4DAE6997F1F567A176 /* SDImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 75D88B759029A2E40EFE8C29125DD473 /* SDImageCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B9AB0B01A8F7F6D3C83AEE614C9304C2 /* Moya-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A3D26C127F6512CE9A967C61E4AC73E3 /* Moya-dummy.m */; }; + BA0C5B65BD21A8CE2EEF79D60D64284A /* UIImage+ForceDecode.m in Sources */ = {isa = PBXBuildFile; fileRef = 61905BE0647662FB519A41D59F7ACDB7 /* UIImage+ForceDecode.m */; }; + BA158509B4673EB6F8D0D12961169AB1 /* Enum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653B44E1CD39DC0F49DD39618C1C0264 /* Enum.swift */; }; + BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1B95A1CB08ACDEDD177E919A5206A9 /* Validation.swift */; }; + BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486B732D8AA8E0E5C7088D076F51D02F /* ParameterEncoding.swift */; }; + BF1D9661DE35888AB51650BAE6C94CC4 /* SDWebImageGIFCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D7D4FE82237399AE2D8BA8AE6348F6D /* SDWebImageGIFCoder.m */; }; + C3079113A27F987B6889C2E9C05A10DD /* FontAwesome.otf in Resources */ = {isa = PBXBuildFile; fileRef = CA13F52472D8AFD735289E38C17EC663 /* FontAwesome.otf */; }; + C363E18E44971D5E33AF7542A0093B53 /* UIButton+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 20DECA6E551432F5E079A1F7ADF698A1 /* UIButton+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C4EDDFD00880AD17F1BB7D66948F1D21 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D57B36DCDFFF88B2CDD89F077E55F825 /* Foundation.framework */; }; + C879A43B7C8CC16E986D40441C2F2878 /* FontAwesomeImageRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2043F633E0A59C037D8D09FB27B7CEB4 /* FontAwesomeImageRepresentable.swift */; }; + CA9638C279C3CE5E03E69CF58E0FF359 /* SDWebImageCodersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = F09292C162497D1F431E7DF7A0C15F34 /* SDWebImageCodersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66E14466CE87330E1D5D45525C1A87DC /* Response.swift */; }; + CBD91B03AC387775166237F805EABC3A /* FontAwesomeStateRequirement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34976BDAD1D70CE47927F6022E5EEDEA /* FontAwesomeStateRequirement.swift */; }; + CE3C81AB6F79F546A226366B69F47C81 /* Pods-CoolCardsIntegrationTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4676CC21AD0B01530D30CD5876821B3E /* Pods-CoolCardsIntegrationTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CEA192A80E93599EFC5BEC6EE1F97BB5 /* Task.swift in Sources */ = {isa = PBXBuildFile; fileRef = FCF12F2874D58DE64910B47995552AF4 /* Task.swift */; }; + D72B97874B2D97A2776598EB768C4926 /* SDImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F37936AD6084E006B76DF81E8B32C60 /* SDImageCache.m */; }; + D947452217EE9CF7F39D5F25C226DACC /* CredentialsPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62F9EF0B36ABCA99CCF6415AFEB9FF4E /* CredentialsPlugin.swift */; }; + DA5DD0C74B28556FF5D59AF81DAF6DB3 /* SDWebImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CA5BD8CAEAA3A0C802D86A5B5368FE5 /* SDWebImageDownloader.m */; }; + DAC2CACA22AE100EB261D377EC6FBE3C /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB394E547B395DCAF8148B30D42BC0A2 /* CoreText.framework */; }; + DB2025B43378C72E262FCAF804B45628 /* SDImageCacheConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C77552E8340936BFEF6E2C6DDEE0124 /* SDImageCacheConfig.m */; }; + DB912D996DC177901DACA697F2EF96F9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D57B36DCDFFF88B2CDD89F077E55F825 /* Foundation.framework */; }; + DBCCE10306122D22ABD5132028DEC06B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D57B36DCDFFF88B2CDD89F077E55F825 /* Foundation.framework */; }; + DC33F13B3A4918492A263CA2AA8ACD97 /* SDWebImageCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DD7E0495D005093D7FCB6628AA4FBCF /* SDWebImageCoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E12CC1F757B84C4C162A9973E8C1A53B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D57B36DCDFFF88B2CDD89F077E55F825 /* Foundation.framework */; }; + E308EFC504C80B3E2EFD793891A9C9DB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D57B36DCDFFF88B2CDD89F077E55F825 /* Foundation.framework */; }; + E5EC05E17A05C3E1C41ACF59BF5E9681 /* SDWebImageDownloaderOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A7E1E360A856B6F25F3494D8769D163 /* SDWebImageDownloaderOperation.m */; }; + E6E665BE665B981FD4E24B2B79A9A220 /* NSImage+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 0267931AF15FD721951A3D14864E4A70 /* NSImage+WebCache.m */; }; + E90C42E14A0317170D5B646B20FE671C /* NSData+ImageContentType.m in Sources */ = {isa = PBXBuildFile; fileRef = 47185C097BD51908276741FD96FE786D /* NSData+ImageContentType.m */; }; + EA22C4778BA43235E03A111DA0B76C77 /* UIImageView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BA459A1076C0C32338C45E02308F5977 /* UIImageView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EA51561888EBD7DD01B3580A7C7A98F8 /* UIView+WebCacheOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BB4409B21D23DFB074065BB5EEFAD8F /* UIView+WebCacheOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EC0418D76D4ADA0C663EE5E8D2D9B57C /* Plugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1016FC3AAF49E3D11CCB9562E4A84A9D /* Plugin.swift */; }; + ED4CDFA145F591A93A57DC1B7CE1C12E /* MoyaProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 106C0B3167FE15D03250628A014F13E3 /* MoyaProvider.swift */; }; + EFCDB86F2D87E50B9B3EAA6827FF4012 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 691DBC179BB4AB67099AABD54D80501F /* Result.swift */; }; + EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E9FE6A0050E031C2EA85FFECA4288AA /* Notifications.swift */; }; + F02BDB37A210D61C8F2F12DC07A93772 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32034D721362FC6716A7AF7B87E93781 /* ImageIO.framework */; }; + F5F3DCAAEFE70A1690D6A1844805E1CC /* SDWebImagePrefetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 89C205BAE2E6D74DD68358A6CF97E440 /* SDWebImagePrefetcher.m */; }; + F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBE873CB3A018ECBB39165EBBD723FF5 /* ResponseSerialization.swift */; }; + F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = D93E8AA06C2FDBD8FBDAFA49434DB126 /* Alamofire.swift */; }; + FB64A64BD408EE7BBD70A4B048315C7D /* FontAwesomeTextRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB2572EEFD398A034FDDF4BA5617D096 /* FontAwesomeTextRepresentable.swift */; }; + FD8C615CEC6F1EBDB63BF3240583D2F3 /* FontAwesome.swift-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D94DEF61DEA3894290049FDA241F238 /* FontAwesome.swift-dummy.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 153A72D098CEAB96FBB38134FED2353E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = CD11672B6619C297B6AEE3DFB8213C59; + remoteInfo = FontAwesome.swift; + }; + 3B4AFC96A3540F2AB057D413E59B4241 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = CD11672B6619C297B6AEE3DFB8213C59; + remoteInfo = FontAwesome.swift; + }; + 54D011DB77F5F3758F38CDBA3EAB88FB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = C421333E50A45E0C264A5294A3276AEA; + remoteInfo = SDWebImage; + }; + 568729D568EF29128461A170F2E8E1AA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = C421333E50A45E0C264A5294A3276AEA; + remoteInfo = SDWebImage; + }; + 576650B517332BE1A2CF8286C2F42E35 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = C421333E50A45E0C264A5294A3276AEA; + remoteInfo = SDWebImage; + }; + 596DB5626A5F23B2C9BE3284495D9368 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; + remoteInfo = Alamofire; + }; + 5B1C65F8897B49CDA0EFA86D8B3E4120 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; + remoteInfo = Alamofire; + }; + 71F0C6F88446528DABBC22DC0C1B6DB2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = CD11672B6619C297B6AEE3DFB8213C59; + remoteInfo = FontAwesome.swift; + }; + 7901EB4137134243FD5464CDD5C1A6EB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = D382A7B90B59D72908CC21054785B020; + remoteInfo = Moya; + }; + 7C0EC51F0ECAA4BE4614668FD2FF0FAD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1C61647CEE01897368F5D0D2CC181DB4; + remoteInfo = Result; + }; + 82780F1A95E9911BBC475BFCAB84E16A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; + remoteInfo = Alamofire; + }; + A1E7ADA9414728070F39599079B02152 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6991F49AED797519343B1F4591001691; + remoteInfo = "FontAwesome.swift-FontAwesome.swift"; + }; + ADBC1B34A6FE3EAAD67BAA91A1C3235B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = D382A7B90B59D72908CC21054785B020; + remoteInfo = Moya; + }; + AFF8E5BA3A8CF17E8A5DAE78D594D289 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = D382A7B90B59D72908CC21054785B020; + remoteInfo = Moya; + }; + B808EA67975338FCD4961E5229E5E9EC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1C61647CEE01897368F5D0D2CC181DB4; + remoteInfo = Result; + }; + B8EABC630088E83DF5C5C6278DC7D264 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1C61647CEE01897368F5D0D2CC181DB4; + remoteInfo = Result; + }; + C291EBE2993E897C362199B1BAEEC035 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; + remoteInfo = Alamofire; + }; + F78D05F575692EA731781B820137FCAC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1C61647CEE01897368F5D0D2CC181DB4; + remoteInfo = Result; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0117038D184F0E30070EF6C34D723D9D /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 0267931AF15FD721951A3D14864E4A70 /* NSImage+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSImage+WebCache.m"; path = "SDWebImage/NSImage+WebCache.m"; sourceTree = ""; }; + 076D5AB461A702694703E3EB816090E7 /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; + 07CB6B6EE1C9CD5B1E1792DF2C3F9498 /* SDWebImageDownloaderOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDownloaderOperation.h; path = SDWebImage/SDWebImageDownloaderOperation.h; sourceTree = ""; }; + 0869846D716A2AC99425E2C2DEF71615 /* Moya-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Moya-umbrella.h"; sourceTree = ""; }; + 0BB4409B21D23DFB074065BB5EEFAD8F /* UIView+WebCacheOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+WebCacheOperation.h"; path = "SDWebImage/UIView+WebCacheOperation.h"; sourceTree = ""; }; + 0EF49B77D7BEF2855722A55A8B9A5B63 /* Moya.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Moya.xcconfig; sourceTree = ""; }; + 0F4932D6C8428C1C3AA7232ACBC636B6 /* UIImageView+HighlightedWebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+HighlightedWebCache.m"; path = "SDWebImage/UIImageView+HighlightedWebCache.m"; sourceTree = ""; }; + 0FDD775FC2FB04033C3CA9BFFEBA03DC /* Pods_CoolCardsIntegrationTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_CoolCardsIntegrationTests.framework; path = "Pods-CoolCardsIntegrationTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1016FC3AAF49E3D11CCB9562E4A84A9D /* Plugin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Plugin.swift; path = Sources/Moya/Plugin.swift; sourceTree = ""; }; + 1069F9470D723B06E49D25984BEFFE24 /* SDWebImage-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SDWebImage-dummy.m"; sourceTree = ""; }; + 106C0B3167FE15D03250628A014F13E3 /* MoyaProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MoyaProvider.swift; path = Sources/Moya/MoyaProvider.swift; sourceTree = ""; }; + 1258FD1D5D649DBC4DF1935AFE45317A /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 12748B744B6EEE738FA8EB00BC419C5A /* MoyaProvider+Defaults.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "MoyaProvider+Defaults.swift"; path = "Sources/Moya/MoyaProvider+Defaults.swift"; sourceTree = ""; }; + 13493708B716141A3E0740B1332606BA /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; + 1389CDE98A9B441C407D82E95FE96C98 /* Pods-CoolCards-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-CoolCards-resources.sh"; sourceTree = ""; }; + 167743B773E7E3C319ECD6FEAF68AFB4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 172424BD80FDB52E9E019698F4FEDAAD /* SDWebImageImageIOCoder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageImageIOCoder.m; path = SDWebImage/SDWebImageImageIOCoder.m; sourceTree = ""; }; + 1D53907721A2818751E2565E95CEA9FF /* TargetType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TargetType.swift; path = Sources/Moya/TargetType.swift; sourceTree = ""; }; + 1F9DE532D29285847E9C471C7AEACA02 /* NetworkLoggerPlugin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkLoggerPlugin.swift; path = Sources/Moya/Plugins/NetworkLoggerPlugin.swift; sourceTree = ""; }; + 2043F633E0A59C037D8D09FB27B7CEB4 /* FontAwesomeImageRepresentable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FontAwesomeImageRepresentable.swift; path = FontAwesome/FontAwesomeImageRepresentable.swift; sourceTree = ""; }; + 20CAC952E63234D56A9647302F581D8D /* MoyaProvider+Internal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "MoyaProvider+Internal.swift"; path = "Sources/Moya/MoyaProvider+Internal.swift"; sourceTree = ""; }; + 20DECA6E551432F5E079A1F7ADF698A1 /* UIButton+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIButton+WebCache.h"; path = "SDWebImage/UIButton+WebCache.h"; sourceTree = ""; }; + 2103F770B4BF7E0A04F1320BF481A33A /* FontAwesomeTabBarItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FontAwesomeTabBarItem.swift; path = FontAwesome/FontAwesomeTabBarItem.swift; sourceTree = ""; }; + 2167A52AE4A7D48F2289FE0179C06729 /* FontAwesome.swift.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FontAwesome.swift.xcconfig; sourceTree = ""; }; + 22F55A6EB0DB0A600D4AB6E75AF354D9 /* MoyaError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MoyaError.swift; path = Sources/Moya/MoyaError.swift; sourceTree = ""; }; + 25DEB570E8FB8E9F612DC1165A3B3CE4 /* SDWebImageCoderHelper.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageCoderHelper.m; path = SDWebImage/SDWebImageCoderHelper.m; sourceTree = ""; }; + 2626C9670B3E81B4F5AFDBC70E333475 /* SDWebImageFrame.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageFrame.m; path = SDWebImage/SDWebImageFrame.m; sourceTree = ""; }; + 26928A69FA0E58FD08630520AEE0C699 /* Pods-CoolCardsIntegrationTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-CoolCardsIntegrationTests-resources.sh"; sourceTree = ""; }; + 2730B80A1BDF8B39A5E3E6C4F46FD917 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; + 289473BACBD212B7844469512EFE2901 /* FontAwesome.swift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = FontAwesome.swift.modulemap; sourceTree = ""; }; + 28F5CBA5D57145670252BA3210EBF36D /* NSImage+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSImage+WebCache.h"; path = "SDWebImage/NSImage+WebCache.h"; sourceTree = ""; }; + 2CA5BD8CAEAA3A0C802D86A5B5368FE5 /* SDWebImageDownloader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDownloader.m; path = SDWebImage/SDWebImageDownloader.m; sourceTree = ""; }; + 2D7D4FE82237399AE2D8BA8AE6348F6D /* SDWebImageGIFCoder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageGIFCoder.m; path = SDWebImage/SDWebImageGIFCoder.m; sourceTree = ""; }; + 31E6AD4789FE9486F33CC163D2350E06 /* Pods-CoolCards-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-CoolCards-acknowledgements.markdown"; sourceTree = ""; }; + 32034D721362FC6716A7AF7B87E93781 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/ImageIO.framework; sourceTree = DEVELOPER_DIR; }; + 3373737441A29B65F9B9355B11A3FA64 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; + 34976BDAD1D70CE47927F6022E5EEDEA /* FontAwesomeStateRequirement.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FontAwesomeStateRequirement.swift; path = FontAwesome/FontAwesomeStateRequirement.swift; sourceTree = ""; }; + 35217E1D3CEB9D16E5A80F92CB7321B7 /* FontAwesome.swift-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FontAwesome.swift-prefix.pch"; sourceTree = ""; }; + 355F7D22A4C0119FC564A9941E6DECBB /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; + 35605632778BDE07048D48A0BAFC1863 /* SDWebImage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SDWebImage.xcconfig; sourceTree = ""; }; + 39137C391F8E7037BA5532CAE6FF1D04 /* FontAwesomeView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FontAwesomeView.swift; path = FontAwesome/FontAwesomeView.swift; sourceTree = ""; }; + 391D34FA282A01CE06FDF0714165834A /* Result.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Result.xcconfig; sourceTree = ""; }; + 3BA3775B4FAF8A854BADB9ACFDEC1F6C /* Result-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Result-umbrella.h"; sourceTree = ""; }; + 3D6851D0FA7997B4B5183A64917FE051 /* Pods-CoolCardsIntegrationTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-CoolCardsIntegrationTests-acknowledgements.markdown"; sourceTree = ""; }; + 3F0B01DDD5246235FB73D954AA6F165E /* SDWebImageGIFCoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageGIFCoder.h; path = SDWebImage/SDWebImageGIFCoder.h; sourceTree = ""; }; + 3F727C55130407C51E7FDA2FC2B6ACCD /* Pods-CoolCardsTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-CoolCardsTests-dummy.m"; sourceTree = ""; }; + 4208834FDF79B316D2386A8AE0D094E7 /* SDWebImage-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SDWebImage-umbrella.h"; sourceTree = ""; }; + 44FEB3A76DFF754DF9EAF6E1A1584D8A /* Pods-CoolCardsIntegrationTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-CoolCardsIntegrationTests-frameworks.sh"; sourceTree = ""; }; + 45572E2B06D86E4E6E3DD5F9AD204019 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Sources/Moya/MultipartFormData.swift; sourceTree = ""; }; + 4676CC21AD0B01530D30CD5876821B3E /* Pods-CoolCardsIntegrationTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-CoolCardsIntegrationTests-umbrella.h"; sourceTree = ""; }; + 470862EF65658761A3276CB3B6ADEF77 /* SDWebImageOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageOperation.h; path = SDWebImage/SDWebImageOperation.h; sourceTree = ""; }; + 47185C097BD51908276741FD96FE786D /* NSData+ImageContentType.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSData+ImageContentType.m"; path = "SDWebImage/NSData+ImageContentType.m"; sourceTree = ""; }; + 486B732D8AA8E0E5C7088D076F51D02F /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; + 48E402A1EDD015733A9B61F3A68ED592 /* Pods-CoolCardsIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-CoolCardsIntegrationTests.release.xcconfig"; sourceTree = ""; }; + 4B3FF66AB7615EE07EE963904F3A30C6 /* Pods-CoolCards-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-CoolCards-umbrella.h"; sourceTree = ""; }; + 4C1B95A1CB08ACDEDD177E919A5206A9 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; + 4FBE5E192B53B87A4156F8797744BCA7 /* SDWebImageCompat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageCompat.h; path = SDWebImage/SDWebImageCompat.h; sourceTree = ""; }; + 50A2B11B21B1CBB38994B6885B5AF45C /* Result-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Result-prefix.pch"; sourceTree = ""; }; + 53CFF7EED7DBD1C0CC8CCD8E94D8679F /* SDWebImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = SDWebImage.framework; path = SDWebImage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 58029899CE79C109AA85F9585BBDA1C9 /* ResultProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResultProtocol.swift; path = Result/ResultProtocol.swift; sourceTree = ""; }; + 59B75E7B8008F695B68A0452681955AD /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; + 59CF1F4AF74F87D8C8A652CFBC93AAED /* Pods-CoolCardsIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-CoolCardsIntegrationTests.debug.xcconfig"; sourceTree = ""; }; + 59F50A08C09D782B7BA7B7431473EABA /* SDImageCacheConfig.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDImageCacheConfig.h; path = SDWebImage/SDImageCacheConfig.h; sourceTree = ""; }; + 5C1D23AE170CC282C2EC6CF5E41EEC17 /* Pods-CoolCardsTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-CoolCardsTests.debug.xcconfig"; sourceTree = ""; }; + 5C77552E8340936BFEF6E2C6DDEE0124 /* SDImageCacheConfig.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageCacheConfig.m; path = SDWebImage/SDImageCacheConfig.m; sourceTree = ""; }; + 5D538A3260B417034EE339D8ACCA9303 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5E800D5FB1134CF74B43AA7518578CB9 /* UIImage+MultiFormat.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+MultiFormat.m"; path = "SDWebImage/UIImage+MultiFormat.m"; sourceTree = ""; }; + 600E3DD4C71C76EB0BFF88A6676901E2 /* Result.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Result.modulemap; sourceTree = ""; }; + 6043006C61EF170EA591937437FA86C1 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; + 60A68B253ACB1A427ADF080F8361E730 /* Pods-CoolCards-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-CoolCards-frameworks.sh"; sourceTree = ""; }; + 60F3F22E9389B63ACD38EA946CE51873 /* UIView+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+WebCache.h"; path = "SDWebImage/UIView+WebCache.h"; sourceTree = ""; }; + 61905BE0647662FB519A41D59F7ACDB7 /* UIImage+ForceDecode.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+ForceDecode.m"; path = "SDWebImage/UIImage+ForceDecode.m"; sourceTree = ""; }; + 61CD5C7B22EC023AA2A57765712925E2 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; + 62F9EF0B36ABCA99CCF6415AFEB9FF4E /* CredentialsPlugin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CredentialsPlugin.swift; path = Sources/Moya/Plugins/CredentialsPlugin.swift; sourceTree = ""; }; + 6444E9B99E774DC8B9660334EBD41392 /* SDWebImageDownloader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDownloader.h; path = SDWebImage/SDWebImageDownloader.h; sourceTree = ""; }; + 650DB02B434F8D00CCB66BFD9DDD2BA7 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 653B44E1CD39DC0F49DD39618C1C0264 /* Enum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Enum.swift; path = FontAwesome/Enum.swift; sourceTree = ""; }; + 65ED8CC239D45243C3EF799F62E305BB /* SDWebImage-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SDWebImage-prefix.pch"; sourceTree = ""; }; + 66E14466CE87330E1D5D45525C1A87DC /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; + 67BDB638E7C4EB51F8678F84327D9BD8 /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Result.framework; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 691DBC179BB4AB67099AABD54D80501F /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Result/Result.swift; sourceTree = ""; }; + 692B49BAF7AA6884C674C17C777FEB6E /* UIImage+MultiFormat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+MultiFormat.h"; path = "SDWebImage/UIImage+MultiFormat.h"; sourceTree = ""; }; + 6DD7E0495D005093D7FCB6628AA4FBCF /* SDWebImageCoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageCoder.h; path = SDWebImage/SDWebImageCoder.h; sourceTree = ""; }; + 6F37936AD6084E006B76DF81E8B32C60 /* SDImageCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageCache.m; path = SDWebImage/SDImageCache.m; sourceTree = ""; }; + 705B27D67C07D10518F514F3E00074BB /* FontAwesome.swift.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = FontAwesome.swift.bundle; path = FontAwesome.swift.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; + 75D88B759029A2E40EFE8C29125DD473 /* SDImageCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDImageCache.h; path = SDWebImage/SDImageCache.h; sourceTree = ""; }; + 77735B0A4E4004D45B19CF278060D9D6 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 794D9CDCE82A555D17430B96BF9B59EA /* SDWebImageImageIOCoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageImageIOCoder.h; path = SDWebImage/SDWebImageImageIOCoder.h; sourceTree = ""; }; + 7C2B63ECBBFC8529D28BB928E3730BBC /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; + 7C7F0894B95289D4D62B7C00D0E70042 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7D832F5879ECC68387719BC6C039792B /* Pods-CoolCards-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-CoolCards-dummy.m"; sourceTree = ""; }; + 831E0490B13599D827435929CD1F1AD4 /* SDWebImageCompat.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageCompat.m; path = SDWebImage/SDWebImageCompat.m; sourceTree = ""; }; + 84ECFF1D57EC8E965A11065F1DFD3B88 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + 89007F91BAAC80A51FD1400AE338ACCB /* URLRequest+Encoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "URLRequest+Encoding.swift"; path = "Sources/Moya/URLRequest+Encoding.swift"; sourceTree = ""; }; + 89C205BAE2E6D74DD68358A6CF97E440 /* SDWebImagePrefetcher.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImagePrefetcher.m; path = SDWebImage/SDWebImagePrefetcher.m; sourceTree = ""; }; + 8A332514E44620E40EEE26A5A5F26B44 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; + 8C25AFEF01D8BB214D55A4D6FB799557 /* FontAwesomeImageView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FontAwesomeImageView.swift; path = FontAwesome/FontAwesomeImageView.swift; sourceTree = ""; }; + 8CE620962D57ED460AAEDD36FCBB444D /* Pods-CoolCardsIntegrationTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-CoolCardsIntegrationTests-dummy.m"; sourceTree = ""; }; + 8D023243175198CF7F8CF6FACDC15389 /* FontAwesomeBarButtonItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FontAwesomeBarButtonItem.swift; path = FontAwesome/FontAwesomeBarButtonItem.swift; sourceTree = ""; }; + 8DB81E77B951CD80C4FB07B1BC2232EE /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8E8DF95CFF75686D7E0B3DB38983DB94 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8F9582E049037C25AA9C364CBDFC0889 /* ResourceBundle-FontAwesome.swift-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-FontAwesome.swift-Info.plist"; sourceTree = ""; }; + 917E3B5978E9B2DBACE8159319C66DD7 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 97516CD76D1EF47F3028A4A492885244 /* Moya.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Moya.modulemap; sourceTree = ""; }; + 975D430BE65F2D0F47BB86598163D0A7 /* Moya.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Moya.framework; path = Moya.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 98E67A888598B721666212341B709BE8 /* Cancellable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Cancellable.swift; path = Sources/Moya/Cancellable.swift; sourceTree = ""; }; + 99544F256105FA1E39FC810696DF42D8 /* SDWebImageFrame.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageFrame.h; path = SDWebImage/SDWebImageFrame.h; sourceTree = ""; }; + 99DC407584A24C7ADA525FE8423C454C /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9A7E1E360A856B6F25F3494D8769D163 /* SDWebImageDownloaderOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDownloaderOperation.m; path = SDWebImage/SDWebImageDownloaderOperation.m; sourceTree = ""; }; + 9C25CC5F8F3028FF0E1A53F27020CECE /* Pods-CoolCardsTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-CoolCardsTests.modulemap"; sourceTree = ""; }; + 9D1AD09AFA5A0E77A0C74005E4E27683 /* UIImage+GIF.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+GIF.m"; path = "SDWebImage/UIImage+GIF.m"; sourceTree = ""; }; + 9D53296648A443FF139862CDBD807073 /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; + 9D94DEF61DEA3894290049FDA241F238 /* FontAwesome.swift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FontAwesome.swift-dummy.m"; sourceTree = ""; }; + 9E8DA1DBB693A5CF2E307485B7461C92 /* Pods-CoolCards.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-CoolCards.debug.xcconfig"; sourceTree = ""; }; + 9E9FE6A0050E031C2EA85FFECA4288AA /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; + A38CC73A50C48C605004C3B4972C8554 /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Sources/Moya/Response.swift; sourceTree = ""; }; + A3D26C127F6512CE9A967C61E4AC73E3 /* Moya-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Moya-dummy.m"; sourceTree = ""; }; + A4D139EB9FFA53F0F372CC238008C185 /* FontAwesomeSegmentedControl.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FontAwesomeSegmentedControl.swift; path = FontAwesome/FontAwesomeSegmentedControl.swift; sourceTree = ""; }; + AA217455517D00B368E78F5CE61C7557 /* NetworkActivityPlugin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkActivityPlugin.swift; path = Sources/Moya/Plugins/NetworkActivityPlugin.swift; sourceTree = ""; }; + B1CC423BAEFE5190F588C4C31FF71EC7 /* SDWebImageManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageManager.h; path = SDWebImage/SDWebImageManager.h; sourceTree = ""; }; + B49AD18D66CB685DC71024052EED5F14 /* Result-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Result-dummy.m"; sourceTree = ""; }; + B61DD667D104418809FD1B738BE65291 /* SDWebImage.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = SDWebImage.modulemap; sourceTree = ""; }; + B684E61D50806A38A3E907A5742C1DB0 /* Pods-CoolCardsTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-CoolCardsTests.release.xcconfig"; sourceTree = ""; }; + B720B5B768DFA88A1254D2FB45A6EED0 /* SDWebImageManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageManager.m; path = SDWebImage/SDWebImageManager.m; sourceTree = ""; }; + B72D59A8D4A2267E5BAE5A0D702F07B7 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; + B7A78CAC414F81BD678ABB294FB6365B /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BA132F1388BDAC1665893EF044B99C5C /* Pods-CoolCardsTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-CoolCardsTests-frameworks.sh"; sourceTree = ""; }; + BA459A1076C0C32338C45E02308F5977 /* UIImageView+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+WebCache.h"; path = "SDWebImage/UIImageView+WebCache.h"; sourceTree = ""; }; + BCC64F849712B9767059DF9F4C375EA0 /* NSData+ImageContentType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSData+ImageContentType.h"; path = "SDWebImage/NSData+ImageContentType.h"; sourceTree = ""; }; + BDB57F13222E750CE7245CF3BAD23A9A /* AnyEncodable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyEncodable.swift; path = Sources/Moya/AnyEncodable.swift; sourceTree = ""; }; + C61B50BAADA97A8E3F3EBC2D47997755 /* UIImage+GIF.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+GIF.h"; path = "SDWebImage/UIImage+GIF.h"; sourceTree = ""; }; + C8FF4BF3C105BF1A7361C9B8BBA767C8 /* Pods-CoolCardsTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-CoolCardsTests-acknowledgements.plist"; sourceTree = ""; }; + CA13F52472D8AFD735289E38C17EC663 /* FontAwesome.otf */ = {isa = PBXFileReference; includeInIndex = 1; name = FontAwesome.otf; path = FontAwesome/FontAwesome.otf; sourceTree = ""; }; + CAF193DDD4EBC6614ECD8F6CC3959AB7 /* UIView+WebCacheOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+WebCacheOperation.m"; path = "SDWebImage/UIView+WebCacheOperation.m"; sourceTree = ""; }; + CB16C3ACB1635BC34E5E1A1E27BE9A8B /* Moya+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Moya+Alamofire.swift"; path = "Sources/Moya/Moya+Alamofire.swift"; sourceTree = ""; }; + CB394E547B395DCAF8148B30D42BC0A2 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/CoreText.framework; sourceTree = DEVELOPER_DIR; }; + CC6F7F7134836AEFCA6C83369FCB2853 /* Pods-CoolCardsIntegrationTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-CoolCardsIntegrationTests.modulemap"; sourceTree = ""; }; + D014E6FFF0C975B78F5049C3C6A504FA /* Pods-CoolCards.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-CoolCards.modulemap"; sourceTree = ""; }; + D09407F5A86820A11ACDD7ACA773284E /* Pods-CoolCards.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-CoolCards.release.xcconfig"; sourceTree = ""; }; + D177CD9C43AE17C38362511779BBBFA6 /* URL+Moya.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "URL+Moya.swift"; path = "Sources/Moya/URL+Moya.swift"; sourceTree = ""; }; + D1ACBD588F7DE3BA036BA6456D43C15F /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; + D566FAEAD254D56AFF55C7C949163E59 /* UIImageView+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+WebCache.m"; path = "SDWebImage/UIImageView+WebCache.m"; sourceTree = ""; }; + D57B36DCDFFF88B2CDD89F077E55F825 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + D58F2CC65342BD04AD0B54743D21BB65 /* SDWebImagePrefetcher.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImagePrefetcher.h; path = SDWebImage/SDWebImagePrefetcher.h; sourceTree = ""; }; + D7F83C85ABDEBB6A3468A3361248B697 /* FontAwesome.swift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FontAwesome.swift-umbrella.h"; sourceTree = ""; }; + D8B3C22FE5FB0F7030518604B497B63B /* Pods-CoolCardsTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-CoolCardsTests-acknowledgements.markdown"; sourceTree = ""; }; + D93E8AA06C2FDBD8FBDAFA49434DB126 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; + DB2572EEFD398A034FDDF4BA5617D096 /* FontAwesomeTextRepresentable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FontAwesomeTextRepresentable.swift; path = FontAwesome/FontAwesomeTextRepresentable.swift; sourceTree = ""; }; + E13E172C1164FECB45D7CB47A57B0FEB /* UIImageView+HighlightedWebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+HighlightedWebCache.h"; path = "SDWebImage/UIImageView+HighlightedWebCache.h"; sourceTree = ""; }; + E205DFEC1178A9729B6EB6977683D259 /* UIButton+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIButton+WebCache.m"; path = "SDWebImage/UIButton+WebCache.m"; sourceTree = ""; }; + E33D11D852D523B92FCCEB5798407942 /* UIView+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+WebCache.m"; path = "SDWebImage/UIView+WebCache.m"; sourceTree = ""; }; + E35CE31C9DF506A33BEDC3CB60EED3FF /* SDWebImageCoder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageCoder.m; path = SDWebImage/SDWebImageCoder.m; sourceTree = ""; }; + E7FD1B082E2F6A9A492707D1080393AB /* UIImage+ForceDecode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+ForceDecode.h"; path = "SDWebImage/UIImage+ForceDecode.h"; sourceTree = ""; }; + EA09AC42DF351B7F8805AC0108A110D5 /* SDWebImageCodersManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageCodersManager.m; path = SDWebImage/SDWebImageCodersManager.m; sourceTree = ""; }; + EBE873CB3A018ECBB39165EBBD723FF5 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; + EDB939A2B4A4F4689A1A3A5E35EDE554 /* Pods-CoolCardsTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-CoolCardsTests-resources.sh"; sourceTree = ""; }; + EF1DA77AA002E4905CC11E02DEE77B51 /* Pods_CoolCards.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_CoolCards.framework; path = "Pods-CoolCards.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + EF8EF7A2DC7119E3DF5FDBE8BFB23B9E /* Moya-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Moya-prefix.pch"; sourceTree = ""; }; + EFF3508D568CD5A87587300BDFF7F550 /* FontAwesome_swift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = FontAwesome_swift.framework; path = FontAwesome.swift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F09292C162497D1F431E7DF7A0C15F34 /* SDWebImageCodersManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageCodersManager.h; path = SDWebImage/SDWebImageCodersManager.h; sourceTree = ""; }; + F1499F4E3FCB7E22DFFAFCB7E7B29317 /* Pods_CoolCardsTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_CoolCardsTests.framework; path = "Pods-CoolCardsTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + F2AC5D810FFEB6B0751717477D7232FC /* Endpoint.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Endpoint.swift; path = Sources/Moya/Endpoint.swift; sourceTree = ""; }; + F2FAC617C2C98681D3B87FF5999AFE58 /* AccessTokenPlugin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AccessTokenPlugin.swift; path = Sources/Moya/Plugins/AccessTokenPlugin.swift; sourceTree = ""; }; + F2FE1BBF9A1763FEEC49280AB0B25020 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; + F3294229D029894747E0FAD77874A111 /* MultiTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultiTarget.swift; path = Sources/Moya/MultiTarget.swift; sourceTree = ""; }; + F63A3249E9986E857C2D294DD1347CDE /* FontAwesome.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FontAwesome.swift; path = FontAwesome/FontAwesome.swift; sourceTree = ""; }; + F7BD919E7C0711C535E386E6F689D263 /* SDWebImageCoderHelper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageCoderHelper.h; path = SDWebImage/SDWebImageCoderHelper.h; sourceTree = ""; }; + F8A9F73452B75D999CAD30BD6FF862BC /* Pods-CoolCards-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-CoolCards-acknowledgements.plist"; sourceTree = ""; }; + F92A06C22FB538247E71F27A55D561E1 /* Image.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Image.swift; path = Sources/Moya/Image.swift; sourceTree = ""; }; + F9500D086212930D0DC8D4CB503A5BEB /* Pods-CoolCardsIntegrationTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-CoolCardsIntegrationTests-acknowledgements.plist"; sourceTree = ""; }; + FA305C4B4618727464B60E2254E7A481 /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; + FCF12F2874D58DE64910B47995552AF4 /* Task.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Task.swift; path = Sources/Moya/Task.swift; sourceTree = ""; }; + FFC2EB94ECA2AC8FE8C07436E6E56622 /* Pods-CoolCardsTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-CoolCardsTests-umbrella.h"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 0CEE1D12BAA972360F885EF81FC25B94 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E12CC1F757B84C4C162A9973E8C1A53B /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 23D3B010AD4A853FE7ED1D97A480065F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5539A3CD2B653BA23D68AED9ADEA40C5 /* Alamofire.framework in Frameworks */, + DB912D996DC177901DACA697F2EF96F9 /* Foundation.framework in Frameworks */, + 5B72B69DD603A056FE26772F3CFD56E8 /* Result.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4B7C72EFD055B004BD8D36238863B2D5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DBCCE10306122D22ABD5132028DEC06B /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6384E4C1DBDFE6DB82E1EAD08B3F044A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DAC2CACA22AE100EB261D377EC6FBE3C /* CoreText.framework in Frameworks */, + C4EDDFD00880AD17F1BB7D66948F1D21 /* Foundation.framework in Frameworks */, + 684E126B8E890761BBB1A4EB590EA1F3 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9072CD33720138F0E186F3ADD909F14E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E308EFC504C80B3E2EFD793891A9C9DB /* Foundation.framework in Frameworks */, + F02BDB37A210D61C8F2F12DC07A93772 /* ImageIO.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 99195E4207764744AEC07ECCBCD550EB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A28E8D4A24386982F3B36C22677446B7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 449AC53127C17B180EE8D1A7AB38C9D6 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BDD7223FD0C2CB80D01F05BE7F79AD50 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 72A33533B80375C7B4C5248721137E9C /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D4E54942A2F6AE6BC8FF8B5031C56AFF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0295942884277A1C66AE0F9311EAA187 /* Core */ = { + isa = PBXGroup; + children = ( + BCC64F849712B9767059DF9F4C375EA0 /* NSData+ImageContentType.h */, + 47185C097BD51908276741FD96FE786D /* NSData+ImageContentType.m */, + 28F5CBA5D57145670252BA3210EBF36D /* NSImage+WebCache.h */, + 0267931AF15FD721951A3D14864E4A70 /* NSImage+WebCache.m */, + 75D88B759029A2E40EFE8C29125DD473 /* SDImageCache.h */, + 6F37936AD6084E006B76DF81E8B32C60 /* SDImageCache.m */, + 59F50A08C09D782B7BA7B7431473EABA /* SDImageCacheConfig.h */, + 5C77552E8340936BFEF6E2C6DDEE0124 /* SDImageCacheConfig.m */, + 6DD7E0495D005093D7FCB6628AA4FBCF /* SDWebImageCoder.h */, + E35CE31C9DF506A33BEDC3CB60EED3FF /* SDWebImageCoder.m */, + F7BD919E7C0711C535E386E6F689D263 /* SDWebImageCoderHelper.h */, + 25DEB570E8FB8E9F612DC1165A3B3CE4 /* SDWebImageCoderHelper.m */, + F09292C162497D1F431E7DF7A0C15F34 /* SDWebImageCodersManager.h */, + EA09AC42DF351B7F8805AC0108A110D5 /* SDWebImageCodersManager.m */, + 4FBE5E192B53B87A4156F8797744BCA7 /* SDWebImageCompat.h */, + 831E0490B13599D827435929CD1F1AD4 /* SDWebImageCompat.m */, + 6444E9B99E774DC8B9660334EBD41392 /* SDWebImageDownloader.h */, + 2CA5BD8CAEAA3A0C802D86A5B5368FE5 /* SDWebImageDownloader.m */, + 07CB6B6EE1C9CD5B1E1792DF2C3F9498 /* SDWebImageDownloaderOperation.h */, + 9A7E1E360A856B6F25F3494D8769D163 /* SDWebImageDownloaderOperation.m */, + 99544F256105FA1E39FC810696DF42D8 /* SDWebImageFrame.h */, + 2626C9670B3E81B4F5AFDBC70E333475 /* SDWebImageFrame.m */, + 3F0B01DDD5246235FB73D954AA6F165E /* SDWebImageGIFCoder.h */, + 2D7D4FE82237399AE2D8BA8AE6348F6D /* SDWebImageGIFCoder.m */, + 794D9CDCE82A555D17430B96BF9B59EA /* SDWebImageImageIOCoder.h */, + 172424BD80FDB52E9E019698F4FEDAAD /* SDWebImageImageIOCoder.m */, + B1CC423BAEFE5190F588C4C31FF71EC7 /* SDWebImageManager.h */, + B720B5B768DFA88A1254D2FB45A6EED0 /* SDWebImageManager.m */, + 470862EF65658761A3276CB3B6ADEF77 /* SDWebImageOperation.h */, + D58F2CC65342BD04AD0B54743D21BB65 /* SDWebImagePrefetcher.h */, + 89C205BAE2E6D74DD68358A6CF97E440 /* SDWebImagePrefetcher.m */, + 20DECA6E551432F5E079A1F7ADF698A1 /* UIButton+WebCache.h */, + E205DFEC1178A9729B6EB6977683D259 /* UIButton+WebCache.m */, + E7FD1B082E2F6A9A492707D1080393AB /* UIImage+ForceDecode.h */, + 61905BE0647662FB519A41D59F7ACDB7 /* UIImage+ForceDecode.m */, + C61B50BAADA97A8E3F3EBC2D47997755 /* UIImage+GIF.h */, + 9D1AD09AFA5A0E77A0C74005E4E27683 /* UIImage+GIF.m */, + 692B49BAF7AA6884C674C17C777FEB6E /* UIImage+MultiFormat.h */, + 5E800D5FB1134CF74B43AA7518578CB9 /* UIImage+MultiFormat.m */, + E13E172C1164FECB45D7CB47A57B0FEB /* UIImageView+HighlightedWebCache.h */, + 0F4932D6C8428C1C3AA7232ACBC636B6 /* UIImageView+HighlightedWebCache.m */, + BA459A1076C0C32338C45E02308F5977 /* UIImageView+WebCache.h */, + D566FAEAD254D56AFF55C7C949163E59 /* UIImageView+WebCache.m */, + 60F3F22E9389B63ACD38EA946CE51873 /* UIView+WebCache.h */, + E33D11D852D523B92FCCEB5798407942 /* UIView+WebCache.m */, + 0BB4409B21D23DFB074065BB5EEFAD8F /* UIView+WebCacheOperation.h */, + CAF193DDD4EBC6614ECD8F6CC3959AB7 /* UIView+WebCacheOperation.m */, + ); + name = Core; + sourceTree = ""; + }; + 2B18BED089E01DA9A7F6BF89CBDF2F40 /* Alamofire */ = { + isa = PBXGroup; + children = ( + 59B75E7B8008F695B68A0452681955AD /* AFError.swift */, + D93E8AA06C2FDBD8FBDAFA49434DB126 /* Alamofire.swift */, + 3373737441A29B65F9B9355B11A3FA64 /* DispatchQueue+Alamofire.swift */, + 8A332514E44620E40EEE26A5A5F26B44 /* MultipartFormData.swift */, + 917E3B5978E9B2DBACE8159319C66DD7 /* NetworkReachabilityManager.swift */, + 9E9FE6A0050E031C2EA85FFECA4288AA /* Notifications.swift */, + 486B732D8AA8E0E5C7088D076F51D02F /* ParameterEncoding.swift */, + 355F7D22A4C0119FC564A9941E6DECBB /* Request.swift */, + 66E14466CE87330E1D5D45525C1A87DC /* Response.swift */, + EBE873CB3A018ECBB39165EBBD723FF5 /* ResponseSerialization.swift */, + 13493708B716141A3E0740B1332606BA /* Result.swift */, + 2730B80A1BDF8B39A5E3E6C4F46FD917 /* ServerTrustPolicy.swift */, + D1ACBD588F7DE3BA036BA6456D43C15F /* SessionDelegate.swift */, + 076D5AB461A702694703E3EB816090E7 /* SessionManager.swift */, + F2FE1BBF9A1763FEEC49280AB0B25020 /* TaskDelegate.swift */, + FA305C4B4618727464B60E2254E7A481 /* Timeline.swift */, + 4C1B95A1CB08ACDEDD177E919A5206A9 /* Validation.swift */, + 91DEDDDAC0C23AD9305B1868361F549B /* Support Files */, + ); + name = Alamofire; + path = Alamofire; + sourceTree = ""; + }; + 303380362161830DAB6A36EC60E0023B /* FontAwesome.swift */ = { + isa = PBXGroup; + children = ( + 653B44E1CD39DC0F49DD39618C1C0264 /* Enum.swift */, + F63A3249E9986E857C2D294DD1347CDE /* FontAwesome.swift */, + 8D023243175198CF7F8CF6FACDC15389 /* FontAwesomeBarButtonItem.swift */, + 2043F633E0A59C037D8D09FB27B7CEB4 /* FontAwesomeImageRepresentable.swift */, + 8C25AFEF01D8BB214D55A4D6FB799557 /* FontAwesomeImageView.swift */, + A4D139EB9FFA53F0F372CC238008C185 /* FontAwesomeSegmentedControl.swift */, + 34976BDAD1D70CE47927F6022E5EEDEA /* FontAwesomeStateRequirement.swift */, + 2103F770B4BF7E0A04F1320BF481A33A /* FontAwesomeTabBarItem.swift */, + DB2572EEFD398A034FDDF4BA5617D096 /* FontAwesomeTextRepresentable.swift */, + 39137C391F8E7037BA5532CAE6FF1D04 /* FontAwesomeView.swift */, + 8F8E28F4AF6356B036333F6A40D09C25 /* Resources */, + 8D5F5141BE176A3C3046D19E03DD2212 /* Support Files */, + ); + name = FontAwesome.swift; + path = FontAwesome.swift; + sourceTree = ""; + }; + 40D012AF3CAE8ECEBE0D3DD744D1A904 /* iOS */ = { + isa = PBXGroup; + children = ( + CB394E547B395DCAF8148B30D42BC0A2 /* CoreText.framework */, + D57B36DCDFFF88B2CDD89F077E55F825 /* Foundation.framework */, + 32034D721362FC6716A7AF7B87E93781 /* ImageIO.framework */, + 84ECFF1D57EC8E965A11065F1DFD3B88 /* UIKit.framework */, + ); + name = iOS; + sourceTree = ""; + }; + 4B00760AC44DA7F726F56E613AE325A6 /* Result */ = { + isa = PBXGroup; + children = ( + 691DBC179BB4AB67099AABD54D80501F /* Result.swift */, + 58029899CE79C109AA85F9585BBDA1C9 /* ResultProtocol.swift */, + D57B9AB68F72DDAB2782329F1CD288F1 /* Support Files */, + ); + name = Result; + path = Result; + sourceTree = ""; + }; + 7DB346D0F39D3F0E887471402A8071AB = { + isa = PBXGroup; + children = ( + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, + 97D3C9A2FD8615894A96AFB5E7FB3D91 /* Frameworks */, + BBFB7B55109970E351CFFBCE3D8960EB /* Pods */, + C83EC7573C1B051BBA4111F1A6BF0AA0 /* Products */, + 88C95C83B10CC33B43AB1B63658F6C90 /* Targets Support Files */, + ); + sourceTree = ""; + }; + 88C95C83B10CC33B43AB1B63658F6C90 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 91070CCF64531F98D0F0ABCBF8AD9924 /* Pods-CoolCards */, + 953A58255B34F53C2067500E07A6FCD7 /* Pods-CoolCardsIntegrationTests */, + D7D8F275BA14F21E4EC675E060503AC1 /* Pods-CoolCardsTests */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 8D5F5141BE176A3C3046D19E03DD2212 /* Support Files */ = { + isa = PBXGroup; + children = ( + 289473BACBD212B7844469512EFE2901 /* FontAwesome.swift.modulemap */, + 2167A52AE4A7D48F2289FE0179C06729 /* FontAwesome.swift.xcconfig */, + 9D94DEF61DEA3894290049FDA241F238 /* FontAwesome.swift-dummy.m */, + 35217E1D3CEB9D16E5A80F92CB7321B7 /* FontAwesome.swift-prefix.pch */, + D7F83C85ABDEBB6A3468A3361248B697 /* FontAwesome.swift-umbrella.h */, + 650DB02B434F8D00CCB66BFD9DDD2BA7 /* Info.plist */, + 8F9582E049037C25AA9C364CBDFC0889 /* ResourceBundle-FontAwesome.swift-Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/FontAwesome.swift"; + sourceTree = ""; + }; + 8F8E28F4AF6356B036333F6A40D09C25 /* Resources */ = { + isa = PBXGroup; + children = ( + CA13F52472D8AFD735289E38C17EC663 /* FontAwesome.otf */, + ); + name = Resources; + sourceTree = ""; + }; + 91070CCF64531F98D0F0ABCBF8AD9924 /* Pods-CoolCards */ = { + isa = PBXGroup; + children = ( + B7A78CAC414F81BD678ABB294FB6365B /* Info.plist */, + D014E6FFF0C975B78F5049C3C6A504FA /* Pods-CoolCards.modulemap */, + 31E6AD4789FE9486F33CC163D2350E06 /* Pods-CoolCards-acknowledgements.markdown */, + F8A9F73452B75D999CAD30BD6FF862BC /* Pods-CoolCards-acknowledgements.plist */, + 7D832F5879ECC68387719BC6C039792B /* Pods-CoolCards-dummy.m */, + 60A68B253ACB1A427ADF080F8361E730 /* Pods-CoolCards-frameworks.sh */, + 1389CDE98A9B441C407D82E95FE96C98 /* Pods-CoolCards-resources.sh */, + 4B3FF66AB7615EE07EE963904F3A30C6 /* Pods-CoolCards-umbrella.h */, + 9E8DA1DBB693A5CF2E307485B7461C92 /* Pods-CoolCards.debug.xcconfig */, + D09407F5A86820A11ACDD7ACA773284E /* Pods-CoolCards.release.xcconfig */, + ); + name = "Pods-CoolCards"; + path = "Target Support Files/Pods-CoolCards"; + sourceTree = ""; + }; + 91B7541D569CC361FA66BE44AC7176EF /* Support Files */ = { + isa = PBXGroup; + children = ( + 0117038D184F0E30070EF6C34D723D9D /* Info.plist */, + 97516CD76D1EF47F3028A4A492885244 /* Moya.modulemap */, + 0EF49B77D7BEF2855722A55A8B9A5B63 /* Moya.xcconfig */, + A3D26C127F6512CE9A967C61E4AC73E3 /* Moya-dummy.m */, + EF8EF7A2DC7119E3DF5FDBE8BFB23B9E /* Moya-prefix.pch */, + 0869846D716A2AC99425E2C2DEF71615 /* Moya-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/Moya"; + sourceTree = ""; + }; + 91DEDDDAC0C23AD9305B1868361F549B /* Support Files */ = { + isa = PBXGroup; + children = ( + B72D59A8D4A2267E5BAE5A0D702F07B7 /* Alamofire.modulemap */, + 6043006C61EF170EA591937437FA86C1 /* Alamofire.xcconfig */, + 7C2B63ECBBFC8529D28BB928E3730BBC /* Alamofire-dummy.m */, + 9D53296648A443FF139862CDBD807073 /* Alamofire-prefix.pch */, + 61CD5C7B22EC023AA2A57765712925E2 /* Alamofire-umbrella.h */, + 8E8DF95CFF75686D7E0B3DB38983DB94 /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/Alamofire"; + sourceTree = ""; + }; + 953A58255B34F53C2067500E07A6FCD7 /* Pods-CoolCardsIntegrationTests */ = { + isa = PBXGroup; + children = ( + 8DB81E77B951CD80C4FB07B1BC2232EE /* Info.plist */, + CC6F7F7134836AEFCA6C83369FCB2853 /* Pods-CoolCardsIntegrationTests.modulemap */, + 3D6851D0FA7997B4B5183A64917FE051 /* Pods-CoolCardsIntegrationTests-acknowledgements.markdown */, + F9500D086212930D0DC8D4CB503A5BEB /* Pods-CoolCardsIntegrationTests-acknowledgements.plist */, + 8CE620962D57ED460AAEDD36FCBB444D /* Pods-CoolCardsIntegrationTests-dummy.m */, + 44FEB3A76DFF754DF9EAF6E1A1584D8A /* Pods-CoolCardsIntegrationTests-frameworks.sh */, + 26928A69FA0E58FD08630520AEE0C699 /* Pods-CoolCardsIntegrationTests-resources.sh */, + 4676CC21AD0B01530D30CD5876821B3E /* Pods-CoolCardsIntegrationTests-umbrella.h */, + 59CF1F4AF74F87D8C8A652CFBC93AAED /* Pods-CoolCardsIntegrationTests.debug.xcconfig */, + 48E402A1EDD015733A9B61F3A68ED592 /* Pods-CoolCardsIntegrationTests.release.xcconfig */, + ); + name = "Pods-CoolCardsIntegrationTests"; + path = "Target Support Files/Pods-CoolCardsIntegrationTests"; + sourceTree = ""; + }; + 97D3C9A2FD8615894A96AFB5E7FB3D91 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7C7F0894B95289D4D62B7C00D0E70042 /* Alamofire.framework */, + 99DC407584A24C7ADA525FE8423C454C /* Result.framework */, + 40D012AF3CAE8ECEBE0D3DD744D1A904 /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + AAF5D891367D1ADB8EA5879DF2CD996E /* Core */ = { + isa = PBXGroup; + children = ( + F2FAC617C2C98681D3B87FF5999AFE58 /* AccessTokenPlugin.swift */, + BDB57F13222E750CE7245CF3BAD23A9A /* AnyEncodable.swift */, + 98E67A888598B721666212341B709BE8 /* Cancellable.swift */, + 62F9EF0B36ABCA99CCF6415AFEB9FF4E /* CredentialsPlugin.swift */, + F2AC5D810FFEB6B0751717477D7232FC /* Endpoint.swift */, + F92A06C22FB538247E71F27A55D561E1 /* Image.swift */, + CB16C3ACB1635BC34E5E1A1E27BE9A8B /* Moya+Alamofire.swift */, + 22F55A6EB0DB0A600D4AB6E75AF354D9 /* MoyaError.swift */, + 106C0B3167FE15D03250628A014F13E3 /* MoyaProvider.swift */, + 12748B744B6EEE738FA8EB00BC419C5A /* MoyaProvider+Defaults.swift */, + 20CAC952E63234D56A9647302F581D8D /* MoyaProvider+Internal.swift */, + 45572E2B06D86E4E6E3DD5F9AD204019 /* MultipartFormData.swift */, + F3294229D029894747E0FAD77874A111 /* MultiTarget.swift */, + AA217455517D00B368E78F5CE61C7557 /* NetworkActivityPlugin.swift */, + 1F9DE532D29285847E9C471C7AEACA02 /* NetworkLoggerPlugin.swift */, + 1016FC3AAF49E3D11CCB9562E4A84A9D /* Plugin.swift */, + A38CC73A50C48C605004C3B4972C8554 /* Response.swift */, + 1D53907721A2818751E2565E95CEA9FF /* TargetType.swift */, + FCF12F2874D58DE64910B47995552AF4 /* Task.swift */, + D177CD9C43AE17C38362511779BBBFA6 /* URL+Moya.swift */, + 89007F91BAAC80A51FD1400AE338ACCB /* URLRequest+Encoding.swift */, + ); + name = Core; + sourceTree = ""; + }; + AB4A2B3602FC586D657D72D17ABDC2D1 /* Moya */ = { + isa = PBXGroup; + children = ( + AAF5D891367D1ADB8EA5879DF2CD996E /* Core */, + 91B7541D569CC361FA66BE44AC7176EF /* Support Files */, + ); + name = Moya; + path = Moya; + sourceTree = ""; + }; + BBFB7B55109970E351CFFBCE3D8960EB /* Pods */ = { + isa = PBXGroup; + children = ( + 2B18BED089E01DA9A7F6BF89CBDF2F40 /* Alamofire */, + 303380362161830DAB6A36EC60E0023B /* FontAwesome.swift */, + AB4A2B3602FC586D657D72D17ABDC2D1 /* Moya */, + 4B00760AC44DA7F726F56E613AE325A6 /* Result */, + EDC0BF1815EC557BF71D5E16CF447390 /* SDWebImage */, + ); + name = Pods; + sourceTree = ""; + }; + C83EC7573C1B051BBA4111F1A6BF0AA0 /* Products */ = { + isa = PBXGroup; + children = ( + 77735B0A4E4004D45B19CF278060D9D6 /* Alamofire.framework */, + 705B27D67C07D10518F514F3E00074BB /* FontAwesome.swift.bundle */, + EFF3508D568CD5A87587300BDFF7F550 /* FontAwesome_swift.framework */, + 975D430BE65F2D0F47BB86598163D0A7 /* Moya.framework */, + EF1DA77AA002E4905CC11E02DEE77B51 /* Pods_CoolCards.framework */, + 0FDD775FC2FB04033C3CA9BFFEBA03DC /* Pods_CoolCardsIntegrationTests.framework */, + F1499F4E3FCB7E22DFFAFCB7E7B29317 /* Pods_CoolCardsTests.framework */, + 67BDB638E7C4EB51F8678F84327D9BD8 /* Result.framework */, + 53CFF7EED7DBD1C0CC8CCD8E94D8679F /* SDWebImage.framework */, + ); + name = Products; + sourceTree = ""; + }; + D57B9AB68F72DDAB2782329F1CD288F1 /* Support Files */ = { + isa = PBXGroup; + children = ( + 5D538A3260B417034EE339D8ACCA9303 /* Info.plist */, + 600E3DD4C71C76EB0BFF88A6676901E2 /* Result.modulemap */, + 391D34FA282A01CE06FDF0714165834A /* Result.xcconfig */, + B49AD18D66CB685DC71024052EED5F14 /* Result-dummy.m */, + 50A2B11B21B1CBB38994B6885B5AF45C /* Result-prefix.pch */, + 3BA3775B4FAF8A854BADB9ACFDEC1F6C /* Result-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/Result"; + sourceTree = ""; + }; + D7D8F275BA14F21E4EC675E060503AC1 /* Pods-CoolCardsTests */ = { + isa = PBXGroup; + children = ( + 167743B773E7E3C319ECD6FEAF68AFB4 /* Info.plist */, + 9C25CC5F8F3028FF0E1A53F27020CECE /* Pods-CoolCardsTests.modulemap */, + D8B3C22FE5FB0F7030518604B497B63B /* Pods-CoolCardsTests-acknowledgements.markdown */, + C8FF4BF3C105BF1A7361C9B8BBA767C8 /* Pods-CoolCardsTests-acknowledgements.plist */, + 3F727C55130407C51E7FDA2FC2B6ACCD /* Pods-CoolCardsTests-dummy.m */, + BA132F1388BDAC1665893EF044B99C5C /* Pods-CoolCardsTests-frameworks.sh */, + EDB939A2B4A4F4689A1A3A5E35EDE554 /* Pods-CoolCardsTests-resources.sh */, + FFC2EB94ECA2AC8FE8C07436E6E56622 /* Pods-CoolCardsTests-umbrella.h */, + 5C1D23AE170CC282C2EC6CF5E41EEC17 /* Pods-CoolCardsTests.debug.xcconfig */, + B684E61D50806A38A3E907A5742C1DB0 /* Pods-CoolCardsTests.release.xcconfig */, + ); + name = "Pods-CoolCardsTests"; + path = "Target Support Files/Pods-CoolCardsTests"; + sourceTree = ""; + }; + EDC0BF1815EC557BF71D5E16CF447390 /* SDWebImage */ = { + isa = PBXGroup; + children = ( + 0295942884277A1C66AE0F9311EAA187 /* Core */, + F1A3806B0DC36B993F38E98B1FE867F3 /* Support Files */, + ); + name = SDWebImage; + path = SDWebImage; + sourceTree = ""; + }; + F1A3806B0DC36B993F38E98B1FE867F3 /* Support Files */ = { + isa = PBXGroup; + children = ( + 1258FD1D5D649DBC4DF1935AFE45317A /* Info.plist */, + B61DD667D104418809FD1B738BE65291 /* SDWebImage.modulemap */, + 35605632778BDE07048D48A0BAFC1863 /* SDWebImage.xcconfig */, + 1069F9470D723B06E49D25984BEFFE24 /* SDWebImage-dummy.m */, + 65ED8CC239D45243C3EF799F62E305BB /* SDWebImage-prefix.pch */, + 4208834FDF79B316D2386A8AE0D094E7 /* SDWebImage-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/SDWebImage"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 1F17E228431DEE2523D5CF57F888C3E5 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D1410A3EE9B779EBC857519C3CAE2FB /* NSData+ImageContentType.h in Headers */, + 00C739C3F6233D1BE35BD0060F24F461 /* NSImage+WebCache.h in Headers */, + B9760E715020DE4DAE6997F1F567A176 /* SDImageCache.h in Headers */, + 2D28363017E4B05CC994BE054C59C4C7 /* SDImageCacheConfig.h in Headers */, + ABB98C54CA069C00FFE05007DBDD84F7 /* SDWebImage-umbrella.h in Headers */, + DC33F13B3A4918492A263CA2AA8ACD97 /* SDWebImageCoder.h in Headers */, + 41D3D194B0CEFA7E9538D27533CE90E1 /* SDWebImageCoderHelper.h in Headers */, + CA9638C279C3CE5E03E69CF58E0FF359 /* SDWebImageCodersManager.h in Headers */, + 6CA5E85D6DC8B3A19080CA0519E668D9 /* SDWebImageCompat.h in Headers */, + 46517113831036C4DE5608AA51A3AD39 /* SDWebImageDownloader.h in Headers */, + 16E65053553C8459DB864ACCC6B7F6F1 /* SDWebImageDownloaderOperation.h in Headers */, + 3F706026A035BF032423F0D5DCC7DFD5 /* SDWebImageFrame.h in Headers */, + 10CF2B0CC428F0F1AB459273EDA051A6 /* SDWebImageGIFCoder.h in Headers */, + 134061121AC1A0F4F69760136A04A01C /* SDWebImageImageIOCoder.h in Headers */, + 942AE58D88FFF7FBBC734EF99DC0D767 /* SDWebImageManager.h in Headers */, + 9ABA0285F3F722A90DA8D5F6BAF68B6F /* SDWebImageOperation.h in Headers */, + 0BD671A679D3133E70056CF98DE7E67F /* SDWebImagePrefetcher.h in Headers */, + C363E18E44971D5E33AF7542A0093B53 /* UIButton+WebCache.h in Headers */, + 59A9411DF178B5173CC1C6F44A3A30A9 /* UIImage+ForceDecode.h in Headers */, + 451F581CB2A373D14D3C5071F7309CA8 /* UIImage+GIF.h in Headers */, + 4CD83D08679D747C64540BCE78E5B4F6 /* UIImage+MultiFormat.h in Headers */, + 7EB727C4BF3E548C60706E15C861E756 /* UIImageView+HighlightedWebCache.h in Headers */, + EA22C4778BA43235E03A111DA0B76C77 /* UIImageView+WebCache.h in Headers */, + 14955A2D5AA442C34121589CE5D0BC7D /* UIView+WebCache.h in Headers */, + EA51561888EBD7DD01B3580A7C7A98F8 /* UIView+WebCacheOperation.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 20B4009C01845AA2B0A51768447CFC64 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 49E820E70C2D6BDF96BE3BFEF1B5E425 /* Pods-CoolCardsTests-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 25E0772F87878D34BE9C9F522910F6B2 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 24065029085002EAC70A3422A7D39EC1 /* FontAwesome.swift-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 44C7AC23726DE4E6D35D8A1D17730BA9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 555AABD226E4FCBD91442DE5AED8483A /* Moya-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5E04E9A79257B8FFE474D96536DF2388 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CE3C81AB6F79F546A226366B69F47C81 /* Pods-CoolCardsIntegrationTests-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A340465799B12D6E0985A0CED750669E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 65690C3941CEECF30D1509B15E3DBB91 /* Pods-CoolCards-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FAE57A9E7839AD2AA87185DB14179BF9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A36633C20A13B727FE2F135FB3261A24 /* Result-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 0E996063FD6F891BDE2E0B60D8E83511 /* Pods-CoolCardsIntegrationTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = FBB0D71D3E4FB11BD83C60733706FD89 /* Build configuration list for PBXNativeTarget "Pods-CoolCardsIntegrationTests" */; + buildPhases = ( + D299B8B6BCD0EF7D10D13A8D4C9DB40C /* Sources */, + BDD7223FD0C2CB80D01F05BE7F79AD50 /* Frameworks */, + 5E04E9A79257B8FFE474D96536DF2388 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + EF327581999E58D81933607A7380B03E /* PBXTargetDependency */, + 141AB02B7A326F02A13A2E953A178976 /* PBXTargetDependency */, + AC87DB17B7B075DC03DACEEDC7F47B10 /* PBXTargetDependency */, + 019433912739B7CBBE0E911F4A845133 /* PBXTargetDependency */, + FD85E87860B45CC8DB30C8569A0E4005 /* PBXTargetDependency */, + ); + name = "Pods-CoolCardsIntegrationTests"; + productName = "Pods-CoolCardsIntegrationTests"; + productReference = 0FDD775FC2FB04033C3CA9BFFEBA03DC /* Pods_CoolCardsIntegrationTests.framework */; + productType = "com.apple.product-type.framework"; + }; + 1C61647CEE01897368F5D0D2CC181DB4 /* Result */ = { + isa = PBXNativeTarget; + buildConfigurationList = 554EA923463767BCA4352E1E6C624685 /* Build configuration list for PBXNativeTarget "Result" */; + buildPhases = ( + 48F5E24EE7C37D644CA2EC2A3A332CFD /* Sources */, + 4B7C72EFD055B004BD8D36238863B2D5 /* Frameworks */, + FAE57A9E7839AD2AA87185DB14179BF9 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Result; + productName = Result; + productReference = 67BDB638E7C4EB51F8678F84327D9BD8 /* Result.framework */; + productType = "com.apple.product-type.framework"; + }; + 6991F49AED797519343B1F4591001691 /* FontAwesome.swift-FontAwesome.swift */ = { + isa = PBXNativeTarget; + buildConfigurationList = A91ACF4D4E342DEB04B7C57FA8EA6CC1 /* Build configuration list for PBXNativeTarget "FontAwesome.swift-FontAwesome.swift" */; + buildPhases = ( + EFDD05B792A1A2DB330508032AD5AC07 /* Sources */, + D4E54942A2F6AE6BC8FF8B5031C56AFF /* Frameworks */, + F276D87ECE642BAF9150EB9FD4E7269A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "FontAwesome.swift-FontAwesome.swift"; + productName = "FontAwesome.swift-FontAwesome.swift"; + productReference = 705B27D67C07D10518F514F3E00074BB /* FontAwesome.swift.bundle */; + productType = "com.apple.product-type.bundle"; + }; + 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */ = { + isa = PBXNativeTarget; + buildConfigurationList = 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */; + buildPhases = ( + 32B9974868188C4803318E36329C87FE /* Sources */, + 99195E4207764744AEC07ECCBCD550EB /* Frameworks */, + B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Alamofire; + productName = Alamofire; + productReference = 77735B0A4E4004D45B19CF278060D9D6 /* Alamofire.framework */; + productType = "com.apple.product-type.framework"; + }; + C421333E50A45E0C264A5294A3276AEA /* SDWebImage */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4C8D49E91832CA79200CA52047D1FA0F /* Build configuration list for PBXNativeTarget "SDWebImage" */; + buildPhases = ( + 32D0086A62026AE19928552E512EA3C8 /* Sources */, + 9072CD33720138F0E186F3ADD909F14E /* Frameworks */, + 1F17E228431DEE2523D5CF57F888C3E5 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SDWebImage; + productName = SDWebImage; + productReference = 53CFF7EED7DBD1C0CC8CCD8E94D8679F /* SDWebImage.framework */; + productType = "com.apple.product-type.framework"; + }; + CD11672B6619C297B6AEE3DFB8213C59 /* FontAwesome.swift */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8D647550AC543F36CDA7093F28F22389 /* Build configuration list for PBXNativeTarget "FontAwesome.swift" */; + buildPhases = ( + 30237CD8FFC618019ADDBFF6AF503934 /* Sources */, + 6384E4C1DBDFE6DB82E1EAD08B3F044A /* Frameworks */, + 1B380E02C8EEA8102FF78E1D9AC756E8 /* Resources */, + 25E0772F87878D34BE9C9F522910F6B2 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 0ABF2DD2892B1D79E33237954FE96C29 /* PBXTargetDependency */, + ); + name = FontAwesome.swift; + productName = FontAwesome.swift; + productReference = EFF3508D568CD5A87587300BDFF7F550 /* FontAwesome_swift.framework */; + productType = "com.apple.product-type.framework"; + }; + D382A7B90B59D72908CC21054785B020 /* Moya */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8E2F09332A7598018177CF140EEDFC0E /* Build configuration list for PBXNativeTarget "Moya" */; + buildPhases = ( + 147471AB17CA6878A911AE963B2EEF4A /* Sources */, + 23D3B010AD4A853FE7ED1D97A480065F /* Frameworks */, + 44C7AC23726DE4E6D35D8A1D17730BA9 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 2217DC3041FFBBE5E80AAB2A9DC3C930 /* PBXTargetDependency */, + 4EB5F10F6AC0963099F3FC814DF14415 /* PBXTargetDependency */, + ); + name = Moya; + productName = Moya; + productReference = 975D430BE65F2D0F47BB86598163D0A7 /* Moya.framework */; + productType = "com.apple.product-type.framework"; + }; + DABA96938C9D3F3F38514D01E648D646 /* Pods-CoolCards */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1C771EEC08A4505DFA0C07591C76D797 /* Build configuration list for PBXNativeTarget "Pods-CoolCards" */; + buildPhases = ( + 0836BA5CB3253179FDA7D655F11530CB /* Sources */, + 0CEE1D12BAA972360F885EF81FC25B94 /* Frameworks */, + A340465799B12D6E0985A0CED750669E /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ABBD06A546CF90EB79AD30A1D3A331F7 /* PBXTargetDependency */, + 4F7B8CB6E96243C973E85521A1499199 /* PBXTargetDependency */, + B9D9334DD151A50BEFAB4413A471A269 /* PBXTargetDependency */, + FE208EE3E2CD88DCB9776A1A89F3A3A5 /* PBXTargetDependency */, + F313348B7682ED61FACDA4F0F6842179 /* PBXTargetDependency */, + ); + name = "Pods-CoolCards"; + productName = "Pods-CoolCards"; + productReference = EF1DA77AA002E4905CC11E02DEE77B51 /* Pods_CoolCards.framework */; + productType = "com.apple.product-type.framework"; + }; + E8BEC5726F17C82DD83E18C4CB500D84 /* Pods-CoolCardsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97FEBD91579C6EE2A8E85AFD9A387784 /* Build configuration list for PBXNativeTarget "Pods-CoolCardsTests" */; + buildPhases = ( + 8FB3862957E97D5DD33F00BD55ECE001 /* Sources */, + A28E8D4A24386982F3B36C22677446B7 /* Frameworks */, + 20B4009C01845AA2B0A51768447CFC64 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 386C7E68F5665F89BF5D8958FC1059D9 /* PBXTargetDependency */, + 1E786BFE9616E2B5F6A410CF84771509 /* PBXTargetDependency */, + 6A115C6AAC825BBFF543BA7EC32C4D6E /* PBXTargetDependency */, + C3448632F4EA237F3EADF2FB7150E7AF /* PBXTargetDependency */, + 81D28F483EA617AF81ACDB962A413CC5 /* PBXTargetDependency */, + ); + name = "Pods-CoolCardsTests"; + productName = "Pods-CoolCardsTests"; + productReference = F1499F4E3FCB7E22DFFAFCB7E7B29317 /* Pods_CoolCardsTests.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0830; + LastUpgradeCheck = 0700; + }; + buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7DB346D0F39D3F0E887471402A8071AB; + productRefGroup = C83EC7573C1B051BBA4111F1A6BF0AA0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */, + CD11672B6619C297B6AEE3DFB8213C59 /* FontAwesome.swift */, + 6991F49AED797519343B1F4591001691 /* FontAwesome.swift-FontAwesome.swift */, + D382A7B90B59D72908CC21054785B020 /* Moya */, + DABA96938C9D3F3F38514D01E648D646 /* Pods-CoolCards */, + 0E996063FD6F891BDE2E0B60D8E83511 /* Pods-CoolCardsIntegrationTests */, + E8BEC5726F17C82DD83E18C4CB500D84 /* Pods-CoolCardsTests */, + 1C61647CEE01897368F5D0D2CC181DB4 /* Result */, + C421333E50A45E0C264A5294A3276AEA /* SDWebImage */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1B380E02C8EEA8102FF78E1D9AC756E8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4EFA908CA9A3E9A800B618AC902F5990 /* FontAwesome.swift.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F276D87ECE642BAF9150EB9FD4E7269A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C3079113A27F987B6889C2E9C05A10DD /* FontAwesome.otf in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 0836BA5CB3253179FDA7D655F11530CB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7306AF75696AC305A1D48CE159A8B545 /* Pods-CoolCards-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 147471AB17CA6878A911AE963B2EEF4A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 839A55AD3279D154DC55C93BE714B93E /* AccessTokenPlugin.swift in Sources */, + 5BB8EA4A2E5BEAB53FD3C34496F3CEDB /* AnyEncodable.swift in Sources */, + 6BAE5A1DC9D8A6DED87FF11DEA68C04D /* Cancellable.swift in Sources */, + D947452217EE9CF7F39D5F25C226DACC /* CredentialsPlugin.swift in Sources */, + 068EE77B364B309A5973AA63DCE763D0 /* Endpoint.swift in Sources */, + 7B0FACE97300F45175045FD090F70CE2 /* Image.swift in Sources */, + B3D2B497C3F6721D93B9D8C6E459B763 /* Moya+Alamofire.swift in Sources */, + B9AB0B01A8F7F6D3C83AEE614C9304C2 /* Moya-dummy.m in Sources */, + 2641C5F2AF734454E8A6DF94E606EE71 /* MoyaError.swift in Sources */, + A4A7E0E7713372CEF2409C4B6E564837 /* MoyaProvider+Defaults.swift in Sources */, + A03ADFA996990D2DA836E6FFCEE37F36 /* MoyaProvider+Internal.swift in Sources */, + ED4CDFA145F591A93A57DC1B7CE1C12E /* MoyaProvider.swift in Sources */, + 3433BF7613AB168C91A7310C0B5CE6A9 /* MultipartFormData.swift in Sources */, + 4A54582B320910433D1A82740A41FAF1 /* MultiTarget.swift in Sources */, + 03905D0FD58E772457B809C9443B9633 /* NetworkActivityPlugin.swift in Sources */, + 36C33EC0952D217038E06134251A4267 /* NetworkLoggerPlugin.swift in Sources */, + EC0418D76D4ADA0C663EE5E8D2D9B57C /* Plugin.swift in Sources */, + 2968F27F99F394EABFF42645167C47A7 /* Response.swift in Sources */, + A9CA258A1B6D95AA156B0601E9473EF5 /* TargetType.swift in Sources */, + CEA192A80E93599EFC5BEC6EE1F97BB5 /* Task.swift in Sources */, + A46ECAD1FE903ECD9E035F9DB92CCEFE /* URL+Moya.swift in Sources */, + 79B3581182D487C5DBEF24D7E8B263BE /* URLRequest+Encoding.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 30237CD8FFC618019ADDBFF6AF503934 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BA158509B4673EB6F8D0D12961169AB1 /* Enum.swift in Sources */, + 589D19F8FC8F1E9D6360D950D26A7138 /* FontAwesome.swift in Sources */, + FD8C615CEC6F1EBDB63BF3240583D2F3 /* FontAwesome.swift-dummy.m in Sources */, + 5AD3E160E28F5EFC4D17A8668CA322BD /* FontAwesomeBarButtonItem.swift in Sources */, + C879A43B7C8CC16E986D40441C2F2878 /* FontAwesomeImageRepresentable.swift in Sources */, + 2AE0F58A0988D92438C1448C861A154C /* FontAwesomeImageView.swift in Sources */, + 41FAD1CDCD9272883A6CF33FE8FF44E0 /* FontAwesomeSegmentedControl.swift in Sources */, + CBD91B03AC387775166237F805EABC3A /* FontAwesomeStateRequirement.swift in Sources */, + 65D01C54FCF24BF6E6FBCD49F6E7CCB1 /* FontAwesomeTabBarItem.swift in Sources */, + FB64A64BD408EE7BBD70A4B048315C7D /* FontAwesomeTextRepresentable.swift in Sources */, + 522BEF444AEAA78D1747B62ED49C688E /* FontAwesomeView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 32B9974868188C4803318E36329C87FE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */, + A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */, + F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */, + 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */, + B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */, + A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */, + EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */, + BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */, + 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */, + CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */, + F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */, + 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */, + 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */, + 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */, + AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */, + 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */, + 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */, + BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 32D0086A62026AE19928552E512EA3C8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E90C42E14A0317170D5B646B20FE671C /* NSData+ImageContentType.m in Sources */, + E6E665BE665B981FD4E24B2B79A9A220 /* NSImage+WebCache.m in Sources */, + D72B97874B2D97A2776598EB768C4926 /* SDImageCache.m in Sources */, + DB2025B43378C72E262FCAF804B45628 /* SDImageCacheConfig.m in Sources */, + B45296DABC02FAD49DF7AEA9EC7952F1 /* SDWebImage-dummy.m in Sources */, + 4FE5D28732237858ECB53AC00A9BE612 /* SDWebImageCoder.m in Sources */, + 1888D03C6000539D1BDE17A87FD2994B /* SDWebImageCoderHelper.m in Sources */, + 734DB2FCFAF4D4C5FFCF5D2902EEBB98 /* SDWebImageCodersManager.m in Sources */, + 240E2DC68715A5DC24601252620CB11D /* SDWebImageCompat.m in Sources */, + DA5DD0C74B28556FF5D59AF81DAF6DB3 /* SDWebImageDownloader.m in Sources */, + E5EC05E17A05C3E1C41ACF59BF5E9681 /* SDWebImageDownloaderOperation.m in Sources */, + 56C0C5474066BD0F8705C8184A519543 /* SDWebImageFrame.m in Sources */, + BF1D9661DE35888AB51650BAE6C94CC4 /* SDWebImageGIFCoder.m in Sources */, + 359886A1AD98AC0CA4C60D9C1E74219E /* SDWebImageImageIOCoder.m in Sources */, + A2ACDFD0BC4B71542CF335549DD9A893 /* SDWebImageManager.m in Sources */, + F5F3DCAAEFE70A1690D6A1844805E1CC /* SDWebImagePrefetcher.m in Sources */, + 28CF43A5F393209DAC203A70606FF313 /* UIButton+WebCache.m in Sources */, + BA0C5B65BD21A8CE2EEF79D60D64284A /* UIImage+ForceDecode.m in Sources */, + 4E8C422389A0AAE287521D8922975C4D /* UIImage+GIF.m in Sources */, + AC312D7710ABC278C80AD5B333158296 /* UIImage+MultiFormat.m in Sources */, + A6DFDB95B80BEE907484567462424BE0 /* UIImageView+HighlightedWebCache.m in Sources */, + 55E6453BBF2B8D9D118BDF68FA13DCA9 /* UIImageView+WebCache.m in Sources */, + 4BFBC67C4FDE6B231218020E74794569 /* UIView+WebCache.m in Sources */, + 4DB8593B9899B51DEF81B747AC080C1B /* UIView+WebCacheOperation.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 48F5E24EE7C37D644CA2EC2A3A332CFD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 795ED1A351690C7143540C8CB7AA6CD0 /* Result-dummy.m in Sources */, + EFCDB86F2D87E50B9B3EAA6827FF4012 /* Result.swift in Sources */, + 71DD71770F915F1621F0155CFD6CCEDD /* ResultProtocol.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8FB3862957E97D5DD33F00BD55ECE001 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 52CFE2295A6C897E7B1374DC04C10AFA /* Pods-CoolCardsTests-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D299B8B6BCD0EF7D10D13A8D4C9DB40C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 29E3E7618147D1C05CFA6ACCC941792C /* Pods-CoolCardsIntegrationTests-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EFDD05B792A1A2DB330508032AD5AC07 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 019433912739B7CBBE0E911F4A845133 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Result; + target = 1C61647CEE01897368F5D0D2CC181DB4 /* Result */; + targetProxy = 7C0EC51F0ECAA4BE4614668FD2FF0FAD /* PBXContainerItemProxy */; + }; + 0ABF2DD2892B1D79E33237954FE96C29 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "FontAwesome.swift-FontAwesome.swift"; + target = 6991F49AED797519343B1F4591001691 /* FontAwesome.swift-FontAwesome.swift */; + targetProxy = A1E7ADA9414728070F39599079B02152 /* PBXContainerItemProxy */; + }; + 141AB02B7A326F02A13A2E953A178976 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FontAwesome.swift; + target = CD11672B6619C297B6AEE3DFB8213C59 /* FontAwesome.swift */; + targetProxy = 71F0C6F88446528DABBC22DC0C1B6DB2 /* PBXContainerItemProxy */; + }; + 1E786BFE9616E2B5F6A410CF84771509 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FontAwesome.swift; + target = CD11672B6619C297B6AEE3DFB8213C59 /* FontAwesome.swift */; + targetProxy = 3B4AFC96A3540F2AB057D413E59B4241 /* PBXContainerItemProxy */; + }; + 2217DC3041FFBBE5E80AAB2A9DC3C930 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; + targetProxy = C291EBE2993E897C362199B1BAEEC035 /* PBXContainerItemProxy */; + }; + 386C7E68F5665F89BF5D8958FC1059D9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; + targetProxy = 82780F1A95E9911BBC475BFCAB84E16A /* PBXContainerItemProxy */; + }; + 4EB5F10F6AC0963099F3FC814DF14415 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Result; + target = 1C61647CEE01897368F5D0D2CC181DB4 /* Result */; + targetProxy = F78D05F575692EA731781B820137FCAC /* PBXContainerItemProxy */; + }; + 4F7B8CB6E96243C973E85521A1499199 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FontAwesome.swift; + target = CD11672B6619C297B6AEE3DFB8213C59 /* FontAwesome.swift */; + targetProxy = 153A72D098CEAB96FBB38134FED2353E /* PBXContainerItemProxy */; + }; + 6A115C6AAC825BBFF543BA7EC32C4D6E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Moya; + target = D382A7B90B59D72908CC21054785B020 /* Moya */; + targetProxy = 7901EB4137134243FD5464CDD5C1A6EB /* PBXContainerItemProxy */; + }; + 81D28F483EA617AF81ACDB962A413CC5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = SDWebImage; + target = C421333E50A45E0C264A5294A3276AEA /* SDWebImage */; + targetProxy = 54D011DB77F5F3758F38CDBA3EAB88FB /* PBXContainerItemProxy */; + }; + ABBD06A546CF90EB79AD30A1D3A331F7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; + targetProxy = 5B1C65F8897B49CDA0EFA86D8B3E4120 /* PBXContainerItemProxy */; + }; + AC87DB17B7B075DC03DACEEDC7F47B10 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Moya; + target = D382A7B90B59D72908CC21054785B020 /* Moya */; + targetProxy = AFF8E5BA3A8CF17E8A5DAE78D594D289 /* PBXContainerItemProxy */; + }; + B9D9334DD151A50BEFAB4413A471A269 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Moya; + target = D382A7B90B59D72908CC21054785B020 /* Moya */; + targetProxy = ADBC1B34A6FE3EAAD67BAA91A1C3235B /* PBXContainerItemProxy */; + }; + C3448632F4EA237F3EADF2FB7150E7AF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Result; + target = 1C61647CEE01897368F5D0D2CC181DB4 /* Result */; + targetProxy = B8EABC630088E83DF5C5C6278DC7D264 /* PBXContainerItemProxy */; + }; + EF327581999E58D81933607A7380B03E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; + targetProxy = 596DB5626A5F23B2C9BE3284495D9368 /* PBXContainerItemProxy */; + }; + F313348B7682ED61FACDA4F0F6842179 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = SDWebImage; + target = C421333E50A45E0C264A5294A3276AEA /* SDWebImage */; + targetProxy = 576650B517332BE1A2CF8286C2F42E35 /* PBXContainerItemProxy */; + }; + FD85E87860B45CC8DB30C8569A0E4005 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = SDWebImage; + target = C421333E50A45E0C264A5294A3276AEA /* SDWebImage */; + targetProxy = 568729D568EF29128461A170F2E8E1AA /* PBXContainerItemProxy */; + }; + FE208EE3E2CD88DCB9776A1A89F3A3A5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Result; + target = 1C61647CEE01897368F5D0D2CC181DB4 /* Result */; + targetProxy = B808EA67975338FCD4961E5229E5E9EC /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 10E0F6B95DE217B42F6B8B1DD0ECB278 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 35605632778BDE07048D48A0BAFC1863 /* SDWebImage.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SDWebImage/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/SDWebImage/SDWebImage.modulemap"; + PRODUCT_NAME = SDWebImage; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 222A5960BDD29DEB20B10F4A8DFAF46E /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2167A52AE4A7D48F2289FE0179C06729 /* FontAwesome.swift.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/FontAwesome.swift"; + INFOPLIST_FILE = "Target Support Files/FontAwesome.swift/ResourceBundle-FontAwesome.swift-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = FontAwesome.swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = bundle; + }; + name = Debug; + }; + 3A78C6C6C2D06131D871BC32BC49F380 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 59CF1F4AF74F87D8C8A652CFBC93AAED /* Pods-CoolCardsIntegrationTests.debug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-CoolCardsIntegrationTests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_CoolCardsIntegrationTests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 4181C58E1B926984BF5B8C4567FD18EE /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2167A52AE4A7D48F2289FE0179C06729 /* FontAwesome.swift.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/FontAwesome.swift/FontAwesome.swift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FontAwesome.swift/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/FontAwesome.swift/FontAwesome.swift.modulemap"; + PRODUCT_NAME = FontAwesome_swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 547C6D28C98F2D56A0DCE945B0BC6E02 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 35605632778BDE07048D48A0BAFC1863 /* SDWebImage.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SDWebImage/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/SDWebImage/SDWebImage.modulemap"; + PRODUCT_NAME = SDWebImage; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 66C32E1821911953846FB44E49FBFC54 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B684E61D50806A38A3E907A5742C1DB0 /* Pods-CoolCardsTests.release.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-CoolCardsTests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_CoolCardsTests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 6EF90FA0EDF37997245733701E4CE4EF /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9E8DA1DBB693A5CF2E307485B7461C92 /* Pods-CoolCards.debug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-CoolCards/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-CoolCards/Pods-CoolCards.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_CoolCards; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 75A5A59F7E1B3DFC06F14FCE4A7C0931 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0EF49B77D7BEF2855722A55A8B9A5B63 /* Moya.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Moya/Moya-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Moya/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Moya/Moya.modulemap"; + PRODUCT_NAME = Moya; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 7851643B7265E1D88B54B70E594DCFF3 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 391D34FA282A01CE06FDF0714165834A /* Result.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Result/Result-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Result/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Result/Result.modulemap"; + PRODUCT_NAME = Result; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 7C07ED8089F70A31B83996A8910D7F18 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + 7D2587E8F73681633E0B1C77B4A6EFFC /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0EF49B77D7BEF2855722A55A8B9A5B63 /* Moya.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Moya/Moya-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Moya/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Moya/Moya.modulemap"; + PRODUCT_NAME = Moya; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 824FBD39909345D476FADC534728F8A2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D09407F5A86820A11ACDD7ACA773284E /* Pods-CoolCards.release.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-CoolCards/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-CoolCards/Pods-CoolCards.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_CoolCards; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 98F29E7567052F62660DDD7069ADF73C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Release; + }; + B0F5F1530D3F4E518BE2B1A52F98487A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6043006C61EF170EA591937437FA86C1 /* Alamofire.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + PRODUCT_NAME = Alamofire; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + B8CA02655A4B738D82484691EE8CA58F /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6043006C61EF170EA591937437FA86C1 /* Alamofire.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + PRODUCT_NAME = Alamofire; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + C4F5F8A53FF1411A93CCCD1CD7FC9F12 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 391D34FA282A01CE06FDF0714165834A /* Result.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Result/Result-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Result/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Result/Result.modulemap"; + PRODUCT_NAME = Result; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + D6EE27F3DEF0DCD54A3411368103C46F /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2167A52AE4A7D48F2289FE0179C06729 /* FontAwesome.swift.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/FontAwesome.swift/FontAwesome.swift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FontAwesome.swift/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/FontAwesome.swift/FontAwesome.swift.modulemap"; + PRODUCT_NAME = FontAwesome_swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + DB3AAC30B8571A232001F5AB711146B4 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5C1D23AE170CC282C2EC6CF5E41EEC17 /* Pods-CoolCardsTests.debug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-CoolCardsTests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_CoolCardsTests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + EDD47763A67E0C6BD8288913727BED9B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 48E402A1EDD015733A9B61F3A68ED592 /* Pods-CoolCardsIntegrationTests.release.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-CoolCardsIntegrationTests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_CoolCardsIntegrationTests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + FEE81985885E3F6B115EFBC0EB182EA3 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2167A52AE4A7D48F2289FE0179C06729 /* FontAwesome.swift.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/FontAwesome.swift"; + INFOPLIST_FILE = "Target Support Files/FontAwesome.swift/ResourceBundle-FontAwesome.swift-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = FontAwesome.swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = bundle; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1C771EEC08A4505DFA0C07591C76D797 /* Build configuration list for PBXNativeTarget "Pods-CoolCards" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6EF90FA0EDF37997245733701E4CE4EF /* Debug */, + 824FBD39909345D476FADC534728F8A2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7C07ED8089F70A31B83996A8910D7F18 /* Debug */, + 98F29E7567052F62660DDD7069ADF73C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B0F5F1530D3F4E518BE2B1A52F98487A /* Debug */, + B8CA02655A4B738D82484691EE8CA58F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4C8D49E91832CA79200CA52047D1FA0F /* Build configuration list for PBXNativeTarget "SDWebImage" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 547C6D28C98F2D56A0DCE945B0BC6E02 /* Debug */, + 10E0F6B95DE217B42F6B8B1DD0ECB278 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 554EA923463767BCA4352E1E6C624685 /* Build configuration list for PBXNativeTarget "Result" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C4F5F8A53FF1411A93CCCD1CD7FC9F12 /* Debug */, + 7851643B7265E1D88B54B70E594DCFF3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8D647550AC543F36CDA7093F28F22389 /* Build configuration list for PBXNativeTarget "FontAwesome.swift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4181C58E1B926984BF5B8C4567FD18EE /* Debug */, + D6EE27F3DEF0DCD54A3411368103C46F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8E2F09332A7598018177CF140EEDFC0E /* Build configuration list for PBXNativeTarget "Moya" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 75A5A59F7E1B3DFC06F14FCE4A7C0931 /* Debug */, + 7D2587E8F73681633E0B1C77B4A6EFFC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97FEBD91579C6EE2A8E85AFD9A387784 /* Build configuration list for PBXNativeTarget "Pods-CoolCardsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DB3AAC30B8571A232001F5AB711146B4 /* Debug */, + 66C32E1821911953846FB44E49FBFC54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A91ACF4D4E342DEB04B7C57FA8EA6CC1 /* Build configuration list for PBXNativeTarget "FontAwesome.swift-FontAwesome.swift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 222A5960BDD29DEB20B10F4A8DFAF46E /* Debug */, + FEE81985885E3F6B115EFBC0EB182EA3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FBB0D71D3E4FB11BD83C60733706FD89 /* Build configuration list for PBXNativeTarget "Pods-CoolCardsIntegrationTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3A78C6C6C2D06131D871BC32BC49F380 /* Debug */, + EDD47763A67E0C6BD8288913727BED9B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; +} diff --git a/client/Pods/Result/LICENSE b/client/Pods/Result/LICENSE new file mode 100644 index 00000000..3026ee19 --- /dev/null +++ b/client/Pods/Result/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/client/Pods/Result/README.md b/client/Pods/Result/README.md new file mode 100644 index 00000000..7343ade2 --- /dev/null +++ b/client/Pods/Result/README.md @@ -0,0 +1,113 @@ +# Result + +[![Build Status](https://travis-ci.org/antitypical/Result.svg?branch=master)](https://travis-ci.org/antitypical/Result) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![CocoaPods](https://img.shields.io/cocoapods/v/Result.svg)](https://cocoapods.org/) +[![Reference Status](https://www.versioneye.com/objective-c/result/reference_badge.svg?style=flat)](https://www.versioneye.com/objective-c/result/references) + +This is a Swift µframework providing `Result`. + +`Result` values are either successful (wrapping `Value`) or failed (wrapping `Error`). This is similar to Swift’s native `Optional` type: `success` is like `some`, and `failure` is like `none` except with an associated `Error` value. The addition of an associated `Error` allows errors to be passed along for logging or displaying to the user. + +Using this µframework instead of rolling your own `Result` type allows you to easily interface with other frameworks that also use `Result`. + +## Use + +Use `Result` whenever an operation has the possibility of failure. Consider the following example of a function that tries to extract a `String` for a given key from a JSON `Dictionary`. + +```swift +typealias JSONObject = [String: Any] + +enum JSONError: Error { + case noSuchKey(String) + case typeMismatch +} + +func stringForKey(json: JSONObject, key: String) -> Result { + guard let value = json[key] else { + return .failure(.noSuchKey(key)) + } + + if let value = value as? String { + return .success(value) + } + else { + return .failure(.typeMismatch) + } +} +``` + +This function provides a more robust wrapper around the default subscripting provided by `Dictionary`. Rather than return `Any?`, it returns a `Result` that either contains the `String` value for the given key, or an `ErrorType` detailing what went wrong. + +One simple way to handle a `Result` is to deconstruct it using a `switch` statement. + +```swift +switch stringForKey(json, key: "email") { + +case let .success(email): + print("The email is \(email)") + +case let .failure(.noSuchKey(key)): + print("\(key) is not a valid key") + +case .failure(.typeMismatch): + print("Didn't have the right type") +} +``` + +Using a `switch` statement allows powerful pattern matching, and ensures all possible results are covered. Swift 2.0 offers new ways to deconstruct enums like the `if-case` statement, but be wary as such methods do not ensure errors are handled. + +Other methods available for processing `Result` are detailed in the [API documentation](http://cocoadocs.org/docsets/Result/). + +## Result vs. Throws + +Swift 2.0 introduces error handling via throwing and catching `Error`. `Result` accomplishes the same goal by encapsulating the result instead of hijacking control flow. The `Result` abstraction enables powerful functionality such as `map` and `flatMap`, making `Result` more composable than `throw`. + +Since dealing with APIs that throw is common, you can convert such functions into a `Result` by using the `materialize` method. Conversely, a `Result` can be used to throw an error by calling `dematerialize`. + +## Higher Order Functions + +`map` and `flatMap` operate the same as `Optional.map` and `Optional.flatMap` except they apply to `Result`. + +`map` transforms a `Result` into a `Result` of a new type. It does this by taking a function that transforms the `Value` type into a new value. This transformation is only applied in the case of a `success`. In the case of a `failure`, the associated error is re-wrapped in the new `Result`. + +```swift +// transforms a Result to a Result +let idResult = intForKey(json, key:"id").map { id in String(id) } +``` + +Here, the final result is either the id as a `String`, or carries over the `failure` from the previous result. + +`flatMap` is similar to `map` in that in transforms the `Result` into another `Result`. However, the function passed into `flatMap` must return a `Result`. + +An in depth discussion of `map` and `flatMap` is beyond the scope of this documentation. If you would like a deeper understanding, read about functors and monads. This article is a good place to [start](http://www.javiersoto.me/post/106875422394). + +## Integration + +### Carthage + +1. Add this repository as a submodule and/or [add it to your Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile) if you’re using [carthage](https://github.com/Carthage/Carthage/) to manage your dependencies. +2. Drag `Result.xcodeproj` into your project or workspace. +3. Link your target against `Result.framework`. +4. Application targets should ensure that the framework gets copied into their application bundle. (Framework targets should instead require the application linking them to include Result.) + +### Cocoapods + +```ruby +pod 'Result', '~> 3.0.0' +``` + +### Swift Package Manager + +```swift +import PackageDescription + +let package = Package( + name: "MyProject", + targets: [], + dependencies: [ + .Package(url: "https://github.com/antitypical/Result.git", + majorVersion: 3) + ] +) +``` diff --git a/client/Pods/Result/Result/Result.swift b/client/Pods/Result/Result/Result.swift new file mode 100644 index 00000000..c92524d1 --- /dev/null +++ b/client/Pods/Result/Result/Result.swift @@ -0,0 +1,276 @@ +// Copyright (c) 2015 Rob Rix. All rights reserved. + +/// An enum representing either a failure with an explanatory error, or a success with a result value. +public enum Result: ResultProtocol, CustomStringConvertible, CustomDebugStringConvertible { + case success(T) + case failure(Error) + + // MARK: Constructors + + /// Constructs a success wrapping a `value`. + public init(value: T) { + self = .success(value) + } + + /// Constructs a failure wrapping an `error`. + public init(error: Error) { + self = .failure(error) + } + + /// Constructs a result from an `Optional`, failing with `Error` if `nil`. + public init(_ value: T?, failWith: @autoclosure () -> Error) { + self = value.map(Result.success) ?? .failure(failWith()) + } + + /// Constructs a result from a function that uses `throw`, failing with `Error` if throws. + public init(_ f: @autoclosure () throws -> T) { + self.init(attempt: f) + } + + /// Constructs a result from a function that uses `throw`, failing with `Error` if throws. + public init(attempt f: () throws -> T) { + do { + self = .success(try f()) + } catch var error { + if Error.self == AnyError.self { + error = AnyError(error) + } + self = .failure(error as! Error) + } + } + + // MARK: Deconstruction + + /// Returns the value from `success` Results or `throw`s the error. + public func dematerialize() throws -> T { + switch self { + case let .success(value): + return value + case let .failure(error): + throw error + } + } + + /// Case analysis for Result. + /// + /// Returns the value produced by applying `ifFailure` to `failure` Results, or `ifSuccess` to `success` Results. + public func analysis(ifSuccess: (T) -> Result, ifFailure: (Error) -> Result) -> Result { + switch self { + case let .success(value): + return ifSuccess(value) + case let .failure(value): + return ifFailure(value) + } + } + + // MARK: Errors + + /// The domain for errors constructed by Result. + public static var errorDomain: String { return "com.antitypical.Result" } + + /// The userInfo key for source functions in errors constructed by Result. + public static var functionKey: String { return "\(errorDomain).function" } + + /// The userInfo key for source file paths in errors constructed by Result. + public static var fileKey: String { return "\(errorDomain).file" } + + /// The userInfo key for source file line numbers in errors constructed by Result. + public static var lineKey: String { return "\(errorDomain).line" } + + /// Constructs an error. + public static func error(_ message: String? = nil, function: String = #function, file: String = #file, line: Int = #line) -> NSError { + var userInfo: [String: Any] = [ + functionKey: function, + fileKey: file, + lineKey: line, + ] + + if let message = message { + userInfo[NSLocalizedDescriptionKey] = message + } + + return NSError(domain: errorDomain, code: 0, userInfo: userInfo) + } + + + // MARK: CustomStringConvertible + + public var description: String { + return analysis( + ifSuccess: { ".success(\($0))" }, + ifFailure: { ".failure(\($0))" }) + } + + + // MARK: CustomDebugStringConvertible + + public var debugDescription: String { + return description + } +} + +// MARK: - Derive result from failable closure + +public func materialize(_ f: () throws -> T) -> Result { + return materialize(try f()) +} + +public func materialize(_ f: @autoclosure () throws -> T) -> Result { + do { + return .success(try f()) + } catch { + return .failure(AnyError(error)) + } +} + +@available(*, deprecated, message: "Use the overload which returns `Result` instead") +public func materialize(_ f: () throws -> T) -> Result { + return materialize(try f()) +} + +@available(*, deprecated, message: "Use the overload which returns `Result` instead") +public func materialize(_ f: @autoclosure () throws -> T) -> Result { + do { + return .success(try f()) + } catch { +// This isn't great, but it lets us maintain compatibility until this deprecated +// method can be removed. +#if _runtime(_ObjC) + return .failure(error as NSError) +#else + // https://github.com/apple/swift-corelibs-foundation/blob/swift-3.0.2-RELEASE/Foundation/NSError.swift#L314 + let userInfo = _swift_Foundation_getErrorDefaultUserInfo(error) as? [String: Any] + let nsError = NSError(domain: error._domain, code: error._code, userInfo: userInfo) + return .failure(nsError) +#endif + } +} + +// MARK: - Cocoa API conveniences + +#if !os(Linux) + +/// Constructs a `Result` with the result of calling `try` with an error pointer. +/// +/// This is convenient for wrapping Cocoa API which returns an object or `nil` + an error, by reference. e.g.: +/// +/// Result.try { NSData(contentsOfURL: URL, options: .dataReadingMapped, error: $0) } +@available(*, deprecated, message: "This will be removed in Result 4.0. Use `Result.init(attempt:)` instead. See https://github.com/antitypical/Result/issues/85 for the details.") +public func `try`(_ function: String = #function, file: String = #file, line: Int = #line, `try`: (NSErrorPointer) -> T?) -> Result { + var error: NSError? + return `try`(&error).map(Result.success) ?? .failure(error ?? Result.error(function: function, file: file, line: line)) +} + +/// Constructs a `Result` with the result of calling `try` with an error pointer. +/// +/// This is convenient for wrapping Cocoa API which returns a `Bool` + an error, by reference. e.g.: +/// +/// Result.try { NSFileManager.defaultManager().removeItemAtURL(URL, error: $0) } +@available(*, deprecated, message: "This will be removed in Result 4.0. Use `Result.init(attempt:)` instead. See https://github.com/antitypical/Result/issues/85 for the details.") +public func `try`(_ function: String = #function, file: String = #file, line: Int = #line, `try`: (NSErrorPointer) -> Bool) -> Result<(), NSError> { + var error: NSError? + return `try`(&error) ? + .success(()) + : .failure(error ?? Result<(), NSError>.error(function: function, file: file, line: line)) +} + +#endif + +// MARK: - ErrorConvertible conformance + +extension NSError: ErrorConvertible { + public static func error(from error: Swift.Error) -> Self { + func cast(_ error: Swift.Error) -> T { + return error as! T + } + + return cast(error) + } +} + +// MARK: - Errors + +/// An “error” that is impossible to construct. +/// +/// This can be used to describe `Result`s where failures will never +/// be generated. For example, `Result` describes a result that +/// contains an `Int`eger and is guaranteed never to be a `failure`. +public enum NoError: Swift.Error, Equatable { + public static func ==(lhs: NoError, rhs: NoError) -> Bool { + return true + } +} + +/// A type-erased error which wraps an arbitrary error instance. This should be +/// useful for generic contexts. +public struct AnyError: Swift.Error { + /// The underlying error. + public let error: Swift.Error + + public init(_ error: Swift.Error) { + if let anyError = error as? AnyError { + self = anyError + } else { + self.error = error + } + } +} + +extension AnyError: ErrorConvertible { + public static func error(from error: Error) -> AnyError { + return AnyError(error) + } +} + +extension AnyError: CustomStringConvertible { + public var description: String { + return String(describing: error) + } +} + +// There appears to be a bug in Foundation on Linux which prevents this from working: +// https://bugs.swift.org/browse/SR-3565 +// Don't forget to comment the tests back in when removing this check when it's fixed! +#if !os(Linux) + +extension AnyError: LocalizedError { + public var errorDescription: String? { + return error.localizedDescription + } + + public var failureReason: String? { + return (error as? LocalizedError)?.failureReason + } + + public var helpAnchor: String? { + return (error as? LocalizedError)?.helpAnchor + } + + public var recoverySuggestion: String? { + return (error as? LocalizedError)?.recoverySuggestion + } +} + +#endif + +// MARK: - migration support +extension Result { + @available(*, unavailable, renamed: "success") + public static func Success(_: T) -> Result { + fatalError() + } + + @available(*, unavailable, renamed: "failure") + public static func Failure(_: Error) -> Result { + fatalError() + } +} + +extension NSError { + @available(*, unavailable, renamed: "error(from:)") + public static func errorFromErrorType(_ error: Swift.Error) -> Self { + fatalError() + } +} + +import Foundation diff --git a/client/Pods/Result/Result/ResultProtocol.swift b/client/Pods/Result/Result/ResultProtocol.swift new file mode 100644 index 00000000..678f294b --- /dev/null +++ b/client/Pods/Result/Result/ResultProtocol.swift @@ -0,0 +1,203 @@ +// Copyright (c) 2015 Rob Rix. All rights reserved. + +/// A type that can represent either failure with an error or success with a result value. +public protocol ResultProtocol { + associatedtype Value + associatedtype Error: Swift.Error + + /// Constructs a successful result wrapping a `value`. + init(value: Value) + + /// Constructs a failed result wrapping an `error`. + init(error: Error) + + /// Case analysis for ResultProtocol. + /// + /// Returns the value produced by appliying `ifFailure` to the error if self represents a failure, or `ifSuccess` to the result value if self represents a success. + func analysis(ifSuccess: (Value) -> U, ifFailure: (Error) -> U) -> U + + /// Returns the value if self represents a success, `nil` otherwise. + /// + /// A default implementation is provided by a protocol extension. Conforming types may specialize it. + var value: Value? { get } + + /// Returns the error if self represents a failure, `nil` otherwise. + /// + /// A default implementation is provided by a protocol extension. Conforming types may specialize it. + var error: Error? { get } +} + +public extension ResultProtocol { + + /// Returns the value if self represents a success, `nil` otherwise. + public var value: Value? { + return analysis(ifSuccess: { $0 }, ifFailure: { _ in nil }) + } + + /// Returns the error if self represents a failure, `nil` otherwise. + public var error: Error? { + return analysis(ifSuccess: { _ in nil }, ifFailure: { $0 }) + } + + /// Returns a new Result by mapping `Success`es’ values using `transform`, or re-wrapping `Failure`s’ errors. + public func map(_ transform: (Value) -> U) -> Result { + return flatMap { .success(transform($0)) } + } + + /// Returns the result of applying `transform` to `Success`es’ values, or re-wrapping `Failure`’s errors. + public func flatMap(_ transform: (Value) -> Result) -> Result { + return analysis( + ifSuccess: transform, + ifFailure: Result.failure) + } + + /// Returns a Result with a tuple of the receiver and `other` values if both + /// are `Success`es, or re-wrapping the error of the earlier `Failure`. + public func fanout(_ other: @autoclosure () -> R) -> Result<(Value, R.Value), Error> + where Error == R.Error + { + return self.flatMap { left in other().map { right in (left, right) } } + } + + /// Returns a new Result by mapping `Failure`'s values using `transform`, or re-wrapping `Success`es’ values. + public func mapError(_ transform: (Error) -> Error2) -> Result { + return flatMapError { .failure(transform($0)) } + } + + /// Returns the result of applying `transform` to `Failure`’s errors, or re-wrapping `Success`es’ values. + public func flatMapError(_ transform: (Error) -> Result) -> Result { + return analysis( + ifSuccess: Result.success, + ifFailure: transform) + } + + /// Returns a new Result by mapping `Success`es’ values using `success`, and by mapping `Failure`'s values using `failure`. + public func bimap(success: (Value) -> U, failure: (Error) -> Error2) -> Result { + return analysis( + ifSuccess: { .success(success($0)) }, + ifFailure: { .failure(failure($0)) } + ) + } +} + +public extension ResultProtocol { + + // MARK: Higher-order functions + + /// Returns `self.value` if this result is a .Success, or the given value otherwise. Equivalent with `??` + public func recover(_ value: @autoclosure () -> Value) -> Value { + return self.value ?? value() + } + + /// Returns this result if it is a .Success, or the given result otherwise. Equivalent with `??` + public func recover(with result: @autoclosure () -> Self) -> Self { + return analysis( + ifSuccess: { _ in self }, + ifFailure: { _ in result() }) + } +} + +/// Protocol used to constrain `tryMap` to `Result`s with compatible `Error`s. +public protocol ErrorConvertible: Swift.Error { + static func error(from error: Swift.Error) -> Self +} + +public extension ResultProtocol where Error: ErrorConvertible { + + /// Returns the result of applying `transform` to `Success`es’ values, or wrapping thrown errors. + public func tryMap(_ transform: (Value) throws -> U) -> Result { + return flatMap { value in + do { + return .success(try transform(value)) + } + catch { + let convertedError = Error.error(from: error) + // Revisit this in a future version of Swift. https://twitter.com/jckarter/status/672931114944696321 + return .failure(convertedError) + } + } + } +} + +// MARK: - Operators + +infix operator &&& : LogicalConjunctionPrecedence + +/// Returns a Result with a tuple of `left` and `right` values if both are `Success`es, or re-wrapping the error of the earlier `Failure`. +@available(*, deprecated, renamed: "ResultProtocol.fanout(self:_:)") +public func &&& (left: L, right: @autoclosure () -> R) -> Result<(L.Value, R.Value), L.Error> + where L.Error == R.Error +{ + return left.fanout(right) +} + +precedencegroup ChainingPrecedence { + associativity: left + higherThan: TernaryPrecedence +} + +infix operator >>- : ChainingPrecedence + +/// Returns the result of applying `transform` to `Success`es’ values, or re-wrapping `Failure`’s errors. +/// +/// This is a synonym for `flatMap`. +@available(*, deprecated, renamed: "ResultProtocol.flatMap(self:_:)") +public func >>- (result: T, transform: (T.Value) -> Result) -> Result { + return result.flatMap(transform) +} + +/// Returns `true` if `left` and `right` are both `Success`es and their values are equal, or if `left` and `right` are both `Failure`s and their errors are equal. +public func == (left: T, right: T) -> Bool + where T.Value: Equatable, T.Error: Equatable +{ + if let left = left.value, let right = right.value { + return left == right + } else if let left = left.error, let right = right.error { + return left == right + } + return false +} + +/// Returns `true` if `left` and `right` represent different cases, or if they represent the same case but different values. +public func != (left: T, right: T) -> Bool + where T.Value: Equatable, T.Error: Equatable +{ + return !(left == right) +} + +/// Returns the value of `left` if it is a `Success`, or `right` otherwise. Short-circuits. +public func ?? (left: T, right: @autoclosure () -> T.Value) -> T.Value { + return left.recover(right()) +} + +/// Returns `left` if it is a `Success`es, or `right` otherwise. Short-circuits. +public func ?? (left: T, right: @autoclosure () -> T) -> T { + return left.recover(with: right()) +} + +// MARK: - migration support +@available(*, unavailable, renamed: "ResultProtocol") +public typealias ResultType = ResultProtocol + +@available(*, unavailable, renamed: "Error") +public typealias ResultErrorType = Swift.Error + +@available(*, unavailable, renamed: "ErrorConvertible") +public typealias ErrorTypeConvertible = ErrorConvertible + +@available(*, deprecated, renamed: "ErrorConvertible") +public protocol ErrorProtocolConvertible: ErrorConvertible {} + +extension ResultProtocol { + @available(*, unavailable, renamed: "recover(with:)") + public func recoverWith(_ result: @autoclosure () -> Self) -> Self { + fatalError() + } +} + +extension ErrorConvertible { + @available(*, unavailable, renamed: "error(from:)") + public static func errorFromErrorType(_ error: Swift.Error) -> Self { + fatalError() + } +} diff --git a/client/Pods/SDWebImage/LICENSE b/client/Pods/SDWebImage/LICENSE new file mode 100644 index 00000000..92a252a9 --- /dev/null +++ b/client/Pods/SDWebImage/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/client/Pods/SDWebImage/README.md b/client/Pods/SDWebImage/README.md new file mode 100644 index 00000000..1922e9e6 --- /dev/null +++ b/client/Pods/SDWebImage/README.md @@ -0,0 +1,214 @@ +

+ +

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

+ +

+ +

+ +

diff --git a/client/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h b/client/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h new file mode 100644 index 00000000..0ca226d8 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h @@ -0,0 +1,42 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * (c) Fabrice Aneche + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" + +typedef NS_ENUM(NSInteger, SDImageFormat) { + SDImageFormatUndefined = -1, + SDImageFormatJPEG = 0, + SDImageFormatPNG, + SDImageFormatGIF, + SDImageFormatTIFF, + SDImageFormatWebP, + SDImageFormatHEIC +}; + +@interface NSData (ImageContentType) + +/** + * Return image format + * + * @param data the input image data + * + * @return the image format as `SDImageFormat` (enum) + */ ++ (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data; + +/** + Convert SDImageFormat to UTType + + @param format Format as SDImageFormat + @return The UTType as CFStringRef + */ ++ (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m b/client/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m new file mode 100644 index 00000000..6a590611 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m @@ -0,0 +1,98 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * (c) Fabrice Aneche + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "NSData+ImageContentType.h" +#if SD_MAC +#import +#else +#import +#endif + +// Currently Image/IO does not support WebP +#define kSDUTTypeWebP ((__bridge CFStringRef)@"public.webp") +// AVFileTypeHEIC is defined in AVFoundation via iOS 11, we use this without import AVFoundation +#define kSDUTTypeHEIC ((__bridge CFStringRef)@"public.heic") + +@implementation NSData (ImageContentType) + ++ (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data { + if (!data) { + return SDImageFormatUndefined; + } + + // File signatures table: http://www.garykessler.net/library/file_sigs.html + uint8_t c; + [data getBytes:&c length:1]; + switch (c) { + case 0xFF: + return SDImageFormatJPEG; + case 0x89: + return SDImageFormatPNG; + case 0x47: + return SDImageFormatGIF; + case 0x49: + case 0x4D: + return SDImageFormatTIFF; + case 0x52: { + if (data.length >= 12) { + //RIFF....WEBP + NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; + if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { + return SDImageFormatWebP; + } + } + break; + } + case 0x00: { + if (data.length >= 12) { + //....ftypheic ....ftypheix ....ftyphevc ....ftyphevx + NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(4, 8)] encoding:NSASCIIStringEncoding]; + if ([testString isEqualToString:@"ftypheic"] + || [testString isEqualToString:@"ftypheix"] + || [testString isEqualToString:@"ftyphevc"] + || [testString isEqualToString:@"ftyphevx"]) { + return SDImageFormatHEIC; + } + } + break; + } + } + return SDImageFormatUndefined; +} + ++ (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format { + CFStringRef UTType; + switch (format) { + case SDImageFormatJPEG: + UTType = kUTTypeJPEG; + break; + case SDImageFormatPNG: + UTType = kUTTypePNG; + break; + case SDImageFormatGIF: + UTType = kUTTypeGIF; + break; + case SDImageFormatTIFF: + UTType = kUTTypeTIFF; + break; + case SDImageFormatWebP: + UTType = kSDUTTypeWebP; + break; + case SDImageFormatHEIC: + UTType = kSDUTTypeHEIC; + break; + default: + // default is kUTTypePNG + UTType = kUTTypePNG; + break; + } + return UTType; +} + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h b/client/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h new file mode 100644 index 00000000..7515d407 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h @@ -0,0 +1,23 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +#if SD_MAC + +#import + +@interface NSImage (WebCache) + +- (CGImageRef)CGImage; +- (NSArray *)images; +- (BOOL)isGIF; + +@end + +#endif diff --git a/client/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m b/client/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m new file mode 100644 index 00000000..140ed6ce --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m @@ -0,0 +1,41 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "NSImage+WebCache.h" + +#if SD_MAC + +@implementation NSImage (WebCache) + +- (CGImageRef)CGImage { + NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height); + CGImageRef cgImage = [self CGImageForProposedRect:&imageRect context:NULL hints:nil]; + return cgImage; +} + +- (NSArray *)images { + return nil; +} + +- (BOOL)isGIF { + BOOL isGIF = NO; + for (NSImageRep *rep in self.representations) { + if ([rep isKindOfClass:[NSBitmapImageRep class]]) { + NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; + NSUInteger frameCount = [[bitmapRep valueForProperty:NSImageFrameCount] unsignedIntegerValue]; + isGIF = frameCount > 1 ? YES : NO; + break; + } + } + return isGIF; +} + +@end + +#endif + diff --git a/client/Pods/SDWebImage/SDWebImage/SDImageCache.h b/client/Pods/SDWebImage/SDWebImage/SDImageCache.h new file mode 100644 index 00000000..70ee6cea --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDImageCache.h @@ -0,0 +1,266 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" +#import "SDImageCacheConfig.h" + +typedef NS_ENUM(NSInteger, SDImageCacheType) { + /** + * The image wasn't available the SDWebImage caches, but was downloaded from the web. + */ + SDImageCacheTypeNone, + /** + * The image was obtained from the disk cache. + */ + SDImageCacheTypeDisk, + /** + * The image was obtained from the memory cache. + */ + SDImageCacheTypeMemory +}; + +typedef void(^SDCacheQueryCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, SDImageCacheType cacheType); + +typedef void(^SDWebImageCheckCacheCompletionBlock)(BOOL isInCache); + +typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger totalSize); + + +/** + * SDImageCache maintains a memory cache and an optional disk cache. Disk cache write operations are performed + * asynchronous so it doesn’t add unnecessary latency to the UI. + */ +@interface SDImageCache : NSObject + +#pragma mark - Properties + +/** + * Cache Config object - storing all kind of settings + */ +@property (nonatomic, nonnull, readonly) SDImageCacheConfig *config; + +/** + * The maximum "total cost" of the in-memory image cache. The cost function is the number of pixels held in memory. + */ +@property (assign, nonatomic) NSUInteger maxMemoryCost; + +/** + * The maximum number of objects the cache should hold. + */ +@property (assign, nonatomic) NSUInteger maxMemoryCountLimit; + +#pragma mark - Singleton and initialization + +/** + * Returns global shared cache instance + * + * @return SDImageCache global instance + */ ++ (nonnull instancetype)sharedImageCache; + +/** + * Init a new cache store with a specific namespace + * + * @param ns The namespace to use for this cache store + */ +- (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns; + +/** + * Init a new cache store with a specific namespace and directory + * + * @param ns The namespace to use for this cache store + * @param directory Directory to cache disk images in + */ +- (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns + diskCacheDirectory:(nonnull NSString *)directory NS_DESIGNATED_INITIALIZER; + +#pragma mark - Cache paths + +- (nullable NSString *)makeDiskCachePath:(nonnull NSString*)fullNamespace; + +/** + * Add a read-only cache path to search for images pre-cached by SDImageCache + * Useful if you want to bundle pre-loaded images with your app + * + * @param path The path to use for this read-only cache path + */ +- (void)addReadOnlyCachePath:(nonnull NSString *)path; + +#pragma mark - Store Ops + +/** + * Asynchronously store an image into memory and disk cache at the given key. + * + * @param image The image to store + * @param key The unique image cache key, usually it's image absolute URL + * @param completionBlock A block executed after the operation is finished + */ +- (void)storeImage:(nullable UIImage *)image + forKey:(nullable NSString *)key + completion:(nullable SDWebImageNoParamsBlock)completionBlock; + +/** + * Asynchronously store an image into memory and disk cache at the given key. + * + * @param image The image to store + * @param key The unique image cache key, usually it's image absolute URL + * @param toDisk Store the image to disk cache if YES + * @param completionBlock A block executed after the operation is finished + */ +- (void)storeImage:(nullable UIImage *)image + forKey:(nullable NSString *)key + toDisk:(BOOL)toDisk + completion:(nullable SDWebImageNoParamsBlock)completionBlock; + +/** + * Asynchronously store an image into memory and disk cache at the given key. + * + * @param image The image to store + * @param imageData The image data as returned by the server, this representation will be used for disk storage + * instead of converting the given image object into a storable/compressed image format in order + * to save quality and CPU + * @param key The unique image cache key, usually it's image absolute URL + * @param toDisk Store the image to disk cache if YES + * @param completionBlock A block executed after the operation is finished + */ +- (void)storeImage:(nullable UIImage *)image + imageData:(nullable NSData *)imageData + forKey:(nullable NSString *)key + toDisk:(BOOL)toDisk + completion:(nullable SDWebImageNoParamsBlock)completionBlock; + +/** + * Synchronously store image NSData into disk cache at the given key. + * + * @warning This method is synchronous, make sure to call it from the ioQueue + * + * @param imageData The image data to store + * @param key The unique image cache key, usually it's image absolute URL + */ +- (void)storeImageDataToDisk:(nullable NSData *)imageData forKey:(nullable NSString *)key; + +#pragma mark - Query and Retrieve Ops + +/** + * Async check if image exists in disk cache already (does not load the image) + * + * @param key the key describing the url + * @param completionBlock the block to be executed when the check is done. + * @note the completion block will be always executed on the main queue + */ +- (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock; + +/** + * Operation that queries the cache asynchronously and call the completion when done. + * + * @param key The unique key used to store the wanted image + * @param doneBlock The completion block. Will not get called if the operation is cancelled + * + * @return a NSOperation instance containing the cache op + */ +- (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key done:(nullable SDCacheQueryCompletedBlock)doneBlock; + +/** + * Query the memory cache synchronously. + * + * @param key The unique key used to store the image + */ +- (nullable UIImage *)imageFromMemoryCacheForKey:(nullable NSString *)key; + +/** + * Query the disk cache synchronously. + * + * @param key The unique key used to store the image + */ +- (nullable UIImage *)imageFromDiskCacheForKey:(nullable NSString *)key; + +/** + * Query the cache (memory and or disk) synchronously after checking the memory cache. + * + * @param key The unique key used to store the image + */ +- (nullable UIImage *)imageFromCacheForKey:(nullable NSString *)key; + +#pragma mark - Remove Ops + +/** + * Remove the image from memory and disk cache asynchronously + * + * @param key The unique image cache key + * @param completion A block that should be executed after the image has been removed (optional) + */ +- (void)removeImageForKey:(nullable NSString *)key withCompletion:(nullable SDWebImageNoParamsBlock)completion; + +/** + * Remove the image from memory and optionally disk cache asynchronously + * + * @param key The unique image cache key + * @param fromDisk Also remove cache entry from disk if YES + * @param completion A block that should be executed after the image has been removed (optional) + */ +- (void)removeImageForKey:(nullable NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(nullable SDWebImageNoParamsBlock)completion; + +#pragma mark - Cache clean Ops + +/** + * Clear all memory cached images + */ +- (void)clearMemory; + +/** + * Async clear all disk cached images. Non-blocking method - returns immediately. + * @param completion A block that should be executed after cache expiration completes (optional) + */ +- (void)clearDiskOnCompletion:(nullable SDWebImageNoParamsBlock)completion; + +/** + * Async remove all expired cached image from disk. Non-blocking method - returns immediately. + * @param completionBlock A block that should be executed after cache expiration completes (optional) + */ +- (void)deleteOldFilesWithCompletionBlock:(nullable SDWebImageNoParamsBlock)completionBlock; + +#pragma mark - Cache Info + +/** + * Get the size used by the disk cache + */ +- (NSUInteger)getSize; + +/** + * Get the number of images in the disk cache + */ +- (NSUInteger)getDiskCount; + +/** + * Asynchronously calculate the disk cache's size. + */ +- (void)calculateSizeWithCompletionBlock:(nullable SDWebImageCalculateSizeBlock)completionBlock; + +#pragma mark - Cache Paths + +/** + * Get the cache path for a certain key (needs the cache path root folder) + * + * @param key the key (can be obtained from url using cacheKeyForURL) + * @param path the cache path root folder + * + * @return the cache path + */ +- (nullable NSString *)cachePathForKey:(nullable NSString *)key inPath:(nonnull NSString *)path; + +/** + * Get the default cache path for a certain key + * + * @param key the key (can be obtained from url using cacheKeyForURL) + * + * @return the default cache path + */ +- (nullable NSString *)defaultCachePathForKey:(nullable NSString *)key; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDImageCache.m b/client/Pods/SDWebImage/SDWebImage/SDImageCache.m new file mode 100644 index 00000000..15d27d17 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDImageCache.m @@ -0,0 +1,636 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDImageCache.h" +#import +#import "NSImage+WebCache.h" +#import "SDWebImageCodersManager.h" + +// See https://github.com/rs/SDWebImage/pull/1141 for discussion +@interface AutoPurgeCache : NSCache +@end + +@implementation AutoPurgeCache + +- (nonnull instancetype)init { + self = [super init]; + if (self) { +#if SD_UIKIT + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(removeAllObjects) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; +#endif + } + return self; +} + +- (void)dealloc { +#if SD_UIKIT + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; +#endif +} + +@end + + +FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { +#if SD_MAC + return image.size.height * image.size.width; +#elif SD_UIKIT || SD_WATCH + return image.size.height * image.size.width * image.scale * image.scale; +#endif +} + +@interface SDImageCache () + +#pragma mark - Properties +@property (strong, nonatomic, nonnull) NSCache *memCache; +@property (strong, nonatomic, nonnull) NSString *diskCachePath; +@property (strong, nonatomic, nullable) NSMutableArray *customPaths; +@property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t ioQueue; + +@end + + +@implementation SDImageCache { + NSFileManager *_fileManager; +} + +#pragma mark - Singleton, init, dealloc + ++ (nonnull instancetype)sharedImageCache { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (instancetype)init { + return [self initWithNamespace:@"default"]; +} + +- (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns { + NSString *path = [self makeDiskCachePath:ns]; + return [self initWithNamespace:ns diskCacheDirectory:path]; +} + +- (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns + diskCacheDirectory:(nonnull NSString *)directory { + if ((self = [super init])) { + NSString *fullNamespace = [@"com.hackemist.SDWebImageCache." stringByAppendingString:ns]; + + // Create IO serial queue + _ioQueue = dispatch_queue_create("com.hackemist.SDWebImageCache", DISPATCH_QUEUE_SERIAL); + + _config = [[SDImageCacheConfig alloc] init]; + + // Init the memory cache + _memCache = [[AutoPurgeCache alloc] init]; + _memCache.name = fullNamespace; + + // Init the disk cache + if (directory != nil) { + _diskCachePath = [directory stringByAppendingPathComponent:fullNamespace]; + } else { + NSString *path = [self makeDiskCachePath:ns]; + _diskCachePath = path; + } + + dispatch_sync(_ioQueue, ^{ + _fileManager = [NSFileManager new]; + }); + +#if SD_UIKIT + // Subscribe to app events + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(clearMemory) + name:UIApplicationDidReceiveMemoryWarningNotification + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(deleteOldFiles) + name:UIApplicationWillTerminateNotification + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(backgroundDeleteOldFiles) + name:UIApplicationDidEnterBackgroundNotification + object:nil]; +#endif + } + + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + SDDispatchQueueRelease(_ioQueue); +} + +- (void)checkIfQueueIsIOQueue { + const char *currentQueueLabel = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL); + const char *ioQueueLabel = dispatch_queue_get_label(self.ioQueue); + if (strcmp(currentQueueLabel, ioQueueLabel) != 0) { + NSLog(@"This method should be called from the ioQueue"); + } +} + +#pragma mark - Cache paths + +- (void)addReadOnlyCachePath:(nonnull NSString *)path { + if (!self.customPaths) { + self.customPaths = [NSMutableArray new]; + } + + if (![self.customPaths containsObject:path]) { + [self.customPaths addObject:path]; + } +} + +- (nullable NSString *)cachePathForKey:(nullable NSString *)key inPath:(nonnull NSString *)path { + NSString *filename = [self cachedFileNameForKey:key]; + return [path stringByAppendingPathComponent:filename]; +} + +- (nullable NSString *)defaultCachePathForKey:(nullable NSString *)key { + return [self cachePathForKey:key inPath:self.diskCachePath]; +} + +- (nullable NSString *)cachedFileNameForKey:(nullable NSString *)key { + const char *str = key.UTF8String; + if (str == NULL) { + str = ""; + } + unsigned char r[CC_MD5_DIGEST_LENGTH]; + CC_MD5(str, (CC_LONG)strlen(str), r); + NSURL *keyURL = [NSURL URLWithString:key]; + NSString *ext = keyURL ? keyURL.pathExtension : key.pathExtension; + NSString *filename = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%@", + r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], + r[11], r[12], r[13], r[14], r[15], ext.length == 0 ? @"" : [NSString stringWithFormat:@".%@", ext]]; + return filename; +} + +- (nullable NSString *)makeDiskCachePath:(nonnull NSString*)fullNamespace { + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); + return [paths[0] stringByAppendingPathComponent:fullNamespace]; +} + +#pragma mark - Store Ops + +- (void)storeImage:(nullable UIImage *)image + forKey:(nullable NSString *)key + completion:(nullable SDWebImageNoParamsBlock)completionBlock { + [self storeImage:image imageData:nil forKey:key toDisk:YES completion:completionBlock]; +} + +- (void)storeImage:(nullable UIImage *)image + forKey:(nullable NSString *)key + toDisk:(BOOL)toDisk + completion:(nullable SDWebImageNoParamsBlock)completionBlock { + [self storeImage:image imageData:nil forKey:key toDisk:toDisk completion:completionBlock]; +} + +- (void)storeImage:(nullable UIImage *)image + imageData:(nullable NSData *)imageData + forKey:(nullable NSString *)key + toDisk:(BOOL)toDisk + completion:(nullable SDWebImageNoParamsBlock)completionBlock { + if (!image || !key) { + if (completionBlock) { + completionBlock(); + } + return; + } + // if memory cache is enabled + if (self.config.shouldCacheImagesInMemory) { + NSUInteger cost = SDCacheCostForImage(image); + [self.memCache setObject:image forKey:key cost:cost]; + } + + if (toDisk) { + dispatch_async(self.ioQueue, ^{ + @autoreleasepool { + NSData *data = imageData; + if (!data && image) { + // If we do not have any data to detect image format, use PNG format + data = [[SDWebImageCodersManager sharedInstance] encodedDataWithImage:image format:SDImageFormatPNG]; + } + [self storeImageDataToDisk:data forKey:key]; + } + + if (completionBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + completionBlock(); + }); + } + }); + } else { + if (completionBlock) { + completionBlock(); + } + } +} + +- (void)storeImageDataToDisk:(nullable NSData *)imageData forKey:(nullable NSString *)key { + if (!imageData || !key) { + return; + } + + [self checkIfQueueIsIOQueue]; + + if (![_fileManager fileExistsAtPath:_diskCachePath]) { + [_fileManager createDirectoryAtPath:_diskCachePath withIntermediateDirectories:YES attributes:nil error:NULL]; + } + + // get cache Path for image key + NSString *cachePathForKey = [self defaultCachePathForKey:key]; + // transform to NSUrl + NSURL *fileURL = [NSURL fileURLWithPath:cachePathForKey]; + + [_fileManager createFileAtPath:cachePathForKey contents:imageData attributes:nil]; + + // disable iCloud backup + if (self.config.shouldDisableiCloud) { + [fileURL setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil]; + } +} + +#pragma mark - Query and Retrieve Ops + +- (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock { + dispatch_async(_ioQueue, ^{ + BOOL exists = [_fileManager fileExistsAtPath:[self defaultCachePathForKey:key]]; + + // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name + // checking the key with and without the extension + if (!exists) { + exists = [_fileManager fileExistsAtPath:[self defaultCachePathForKey:key].stringByDeletingPathExtension]; + } + + if (completionBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + completionBlock(exists); + }); + } + }); +} + +- (nullable UIImage *)imageFromMemoryCacheForKey:(nullable NSString *)key { + return [self.memCache objectForKey:key]; +} + +- (nullable UIImage *)imageFromDiskCacheForKey:(nullable NSString *)key { + UIImage *diskImage = [self diskImageForKey:key]; + if (diskImage && self.config.shouldCacheImagesInMemory) { + NSUInteger cost = SDCacheCostForImage(diskImage); + [self.memCache setObject:diskImage forKey:key cost:cost]; + } + + return diskImage; +} + +- (nullable UIImage *)imageFromCacheForKey:(nullable NSString *)key { + // First check the in-memory cache... + UIImage *image = [self imageFromMemoryCacheForKey:key]; + if (image) { + return image; + } + + // Second check the disk cache... + image = [self imageFromDiskCacheForKey:key]; + return image; +} + +- (nullable NSData *)diskImageDataBySearchingAllPathsForKey:(nullable NSString *)key { + NSString *defaultPath = [self defaultCachePathForKey:key]; + NSData *data = [NSData dataWithContentsOfFile:defaultPath options:self.config.diskCacheReadingOptions error:nil]; + if (data) { + return data; + } + + // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name + // checking the key with and without the extension + data = [NSData dataWithContentsOfFile:defaultPath.stringByDeletingPathExtension options:self.config.diskCacheReadingOptions error:nil]; + if (data) { + return data; + } + + NSArray *customPaths = [self.customPaths copy]; + for (NSString *path in customPaths) { + NSString *filePath = [self cachePathForKey:key inPath:path]; + NSData *imageData = [NSData dataWithContentsOfFile:filePath options:self.config.diskCacheReadingOptions error:nil]; + if (imageData) { + return imageData; + } + + // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name + // checking the key with and without the extension + imageData = [NSData dataWithContentsOfFile:filePath.stringByDeletingPathExtension options:self.config.diskCacheReadingOptions error:nil]; + if (imageData) { + return imageData; + } + } + + return nil; +} + +- (nullable UIImage *)diskImageForKey:(nullable NSString *)key { + NSData *data = [self diskImageDataBySearchingAllPathsForKey:key]; + if (data) { + UIImage *image = [[SDWebImageCodersManager sharedInstance] decodedImageWithData:data]; + image = [self scaledImageForKey:key image:image]; + if (self.config.shouldDecompressImages) { + image = [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&data options:@{SDWebImageCoderScaleDownLargeImagesKey: @(NO)}]; + } + return image; + } else { + return nil; + } +} + +- (nullable UIImage *)scaledImageForKey:(nullable NSString *)key image:(nullable UIImage *)image { + return SDScaledImageForKey(key, image); +} + +- (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key done:(nullable SDCacheQueryCompletedBlock)doneBlock { + if (!key) { + if (doneBlock) { + doneBlock(nil, nil, SDImageCacheTypeNone); + } + return nil; + } + + // First check the in-memory cache... + UIImage *image = [self imageFromMemoryCacheForKey:key]; + if (image) { + NSData *diskData = nil; + if (image.images) { + diskData = [self diskImageDataBySearchingAllPathsForKey:key]; + } + if (doneBlock) { + doneBlock(image, diskData, SDImageCacheTypeMemory); + } + return nil; + } + + NSOperation *operation = [NSOperation new]; + dispatch_async(self.ioQueue, ^{ + if (operation.isCancelled) { + // do not call the completion if cancelled + return; + } + + @autoreleasepool { + NSData *diskData = [self diskImageDataBySearchingAllPathsForKey:key]; + UIImage *diskImage = [self diskImageForKey:key]; + if (diskImage && self.config.shouldCacheImagesInMemory) { + NSUInteger cost = SDCacheCostForImage(diskImage); + [self.memCache setObject:diskImage forKey:key cost:cost]; + } + + if (doneBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + doneBlock(diskImage, diskData, SDImageCacheTypeDisk); + }); + } + } + }); + + return operation; +} + +#pragma mark - Remove Ops + +- (void)removeImageForKey:(nullable NSString *)key withCompletion:(nullable SDWebImageNoParamsBlock)completion { + [self removeImageForKey:key fromDisk:YES withCompletion:completion]; +} + +- (void)removeImageForKey:(nullable NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(nullable SDWebImageNoParamsBlock)completion { + if (key == nil) { + return; + } + + if (self.config.shouldCacheImagesInMemory) { + [self.memCache removeObjectForKey:key]; + } + + if (fromDisk) { + dispatch_async(self.ioQueue, ^{ + [_fileManager removeItemAtPath:[self defaultCachePathForKey:key] error:nil]; + + if (completion) { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(); + }); + } + }); + } else if (completion){ + completion(); + } + +} + +# pragma mark - Mem Cache settings + +- (void)setMaxMemoryCost:(NSUInteger)maxMemoryCost { + self.memCache.totalCostLimit = maxMemoryCost; +} + +- (NSUInteger)maxMemoryCost { + return self.memCache.totalCostLimit; +} + +- (NSUInteger)maxMemoryCountLimit { + return self.memCache.countLimit; +} + +- (void)setMaxMemoryCountLimit:(NSUInteger)maxCountLimit { + self.memCache.countLimit = maxCountLimit; +} + +#pragma mark - Cache clean Ops + +- (void)clearMemory { + [self.memCache removeAllObjects]; +} + +- (void)clearDiskOnCompletion:(nullable SDWebImageNoParamsBlock)completion { + dispatch_async(self.ioQueue, ^{ + [_fileManager removeItemAtPath:self.diskCachePath error:nil]; + [_fileManager createDirectoryAtPath:self.diskCachePath + withIntermediateDirectories:YES + attributes:nil + error:NULL]; + + if (completion) { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(); + }); + } + }); +} + +- (void)deleteOldFiles { + [self deleteOldFilesWithCompletionBlock:nil]; +} + +- (void)deleteOldFilesWithCompletionBlock:(nullable SDWebImageNoParamsBlock)completionBlock { + dispatch_async(self.ioQueue, ^{ + NSURL *diskCacheURL = [NSURL fileURLWithPath:self.diskCachePath isDirectory:YES]; + NSArray *resourceKeys = @[NSURLIsDirectoryKey, NSURLContentModificationDateKey, NSURLTotalFileAllocatedSizeKey]; + + // This enumerator prefetches useful properties for our cache files. + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtURL:diskCacheURL + includingPropertiesForKeys:resourceKeys + options:NSDirectoryEnumerationSkipsHiddenFiles + errorHandler:NULL]; + + NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:-self.config.maxCacheAge]; + NSMutableDictionary *> *cacheFiles = [NSMutableDictionary dictionary]; + NSUInteger currentCacheSize = 0; + + // Enumerate all of the files in the cache directory. This loop has two purposes: + // + // 1. Removing files that are older than the expiration date. + // 2. Storing file attributes for the size-based cleanup pass. + NSMutableArray *urlsToDelete = [[NSMutableArray alloc] init]; + for (NSURL *fileURL in fileEnumerator) { + NSError *error; + NSDictionary *resourceValues = [fileURL resourceValuesForKeys:resourceKeys error:&error]; + + // Skip directories and errors. + if (error || !resourceValues || [resourceValues[NSURLIsDirectoryKey] boolValue]) { + continue; + } + + // Remove files that are older than the expiration date; + NSDate *modificationDate = resourceValues[NSURLContentModificationDateKey]; + if ([[modificationDate laterDate:expirationDate] isEqualToDate:expirationDate]) { + [urlsToDelete addObject:fileURL]; + continue; + } + + // Store a reference to this file and account for its total size. + NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey]; + currentCacheSize += totalAllocatedSize.unsignedIntegerValue; + cacheFiles[fileURL] = resourceValues; + } + + for (NSURL *fileURL in urlsToDelete) { + [_fileManager removeItemAtURL:fileURL error:nil]; + } + + // If our remaining disk cache exceeds a configured maximum size, perform a second + // size-based cleanup pass. We delete the oldest files first. + if (self.config.maxCacheSize > 0 && currentCacheSize > self.config.maxCacheSize) { + // Target half of our maximum cache size for this cleanup pass. + const NSUInteger desiredCacheSize = self.config.maxCacheSize / 2; + + // Sort the remaining cache files by their last modification time (oldest first). + NSArray *sortedFiles = [cacheFiles keysSortedByValueWithOptions:NSSortConcurrent + usingComparator:^NSComparisonResult(id obj1, id obj2) { + return [obj1[NSURLContentModificationDateKey] compare:obj2[NSURLContentModificationDateKey]]; + }]; + + // Delete files until we fall below our desired cache size. + for (NSURL *fileURL in sortedFiles) { + if ([_fileManager removeItemAtURL:fileURL error:nil]) { + NSDictionary *resourceValues = cacheFiles[fileURL]; + NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey]; + currentCacheSize -= totalAllocatedSize.unsignedIntegerValue; + + if (currentCacheSize < desiredCacheSize) { + break; + } + } + } + } + if (completionBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + completionBlock(); + }); + } + }); +} + +#if SD_UIKIT +- (void)backgroundDeleteOldFiles { + Class UIApplicationClass = NSClassFromString(@"UIApplication"); + if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) { + return; + } + UIApplication *application = [UIApplication performSelector:@selector(sharedApplication)]; + __block UIBackgroundTaskIdentifier bgTask = [application beginBackgroundTaskWithExpirationHandler:^{ + // Clean up any unfinished task business by marking where you + // stopped or ending the task outright. + [application endBackgroundTask:bgTask]; + bgTask = UIBackgroundTaskInvalid; + }]; + + // Start the long-running task and return immediately. + [self deleteOldFilesWithCompletionBlock:^{ + [application endBackgroundTask:bgTask]; + bgTask = UIBackgroundTaskInvalid; + }]; +} +#endif + +#pragma mark - Cache Info + +- (NSUInteger)getSize { + __block NSUInteger size = 0; + dispatch_sync(self.ioQueue, ^{ + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath]; + for (NSString *fileName in fileEnumerator) { + NSString *filePath = [self.diskCachePath stringByAppendingPathComponent:fileName]; + NSDictionary *attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil]; + size += [attrs fileSize]; + } + }); + return size; +} + +- (NSUInteger)getDiskCount { + __block NSUInteger count = 0; + dispatch_sync(self.ioQueue, ^{ + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath]; + count = fileEnumerator.allObjects.count; + }); + return count; +} + +- (void)calculateSizeWithCompletionBlock:(nullable SDWebImageCalculateSizeBlock)completionBlock { + NSURL *diskCacheURL = [NSURL fileURLWithPath:self.diskCachePath isDirectory:YES]; + + dispatch_async(self.ioQueue, ^{ + NSUInteger fileCount = 0; + NSUInteger totalSize = 0; + + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtURL:diskCacheURL + includingPropertiesForKeys:@[NSFileSize] + options:NSDirectoryEnumerationSkipsHiddenFiles + errorHandler:NULL]; + + for (NSURL *fileURL in fileEnumerator) { + NSNumber *fileSize; + [fileURL getResourceValue:&fileSize forKey:NSURLFileSizeKey error:NULL]; + totalSize += fileSize.unsignedIntegerValue; + fileCount += 1; + } + + if (completionBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + completionBlock(fileCount, totalSize); + }); + } + }); +} + +@end + diff --git a/client/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h b/client/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h new file mode 100644 index 00000000..20f2d108 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h @@ -0,0 +1,46 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" + +@interface SDImageCacheConfig : NSObject + +/** + * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. + * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. + */ +@property (assign, nonatomic) BOOL shouldDecompressImages; + +/** + * disable iCloud backup [defaults to YES] + */ +@property (assign, nonatomic) BOOL shouldDisableiCloud; + +/** + * use memory cache [defaults to YES] + */ +@property (assign, nonatomic) BOOL shouldCacheImagesInMemory; + +/** + * The reading options while reading cache from disk. + * Defaults to 0. You can set this to mapped file to improve performance. + */ +@property (assign, nonatomic) NSDataReadingOptions diskCacheReadingOptions; + +/** + * The maximum length of time to keep an image in the cache, in seconds. + */ +@property (assign, nonatomic) NSInteger maxCacheAge; + +/** + * The maximum size of the cache, in bytes. + */ +@property (assign, nonatomic) NSUInteger maxCacheSize; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m b/client/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m new file mode 100644 index 00000000..7a5af6cb --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m @@ -0,0 +1,27 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDImageCacheConfig.h" + +static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week + +@implementation SDImageCacheConfig + +- (instancetype)init { + if (self = [super init]) { + _shouldDecompressImages = YES; + _shouldDisableiCloud = YES; + _shouldCacheImagesInMemory = YES; + _diskCacheReadingOptions = 0; + _maxCacheAge = kDefaultCacheMaxCacheAge; + _maxCacheSize = 0; + } + return self; +} + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageCoder.h b/client/Pods/SDWebImage/SDWebImage/SDWebImageCoder.h new file mode 100644 index 00000000..7c0a63f2 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageCoder.h @@ -0,0 +1,119 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" +#import "NSData+ImageContentType.h" + +/** + A Boolean value indicating whether to scale down large images during decompressing. (NSNumber) + */ +FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageCoderScaleDownLargeImagesKey; + +/** + Return the shared device-dependent RGB color space created with CGColorSpaceCreateDeviceRGB. + + @return The device-dependent RGB color space + */ +CG_EXTERN CGColorSpaceRef _Nonnull SDCGColorSpaceGetDeviceRGB(void); + +/** + Check whether CGImageRef contains alpha channel. + + @param imageRef The CGImageRef + @return Return YES if CGImageRef contains alpha channel, otherwise return NO + */ +CG_EXTERN BOOL SDCGImageRefContainsAlpha(_Nullable CGImageRef imageRef); + + +/** + This is the image coder protocol to provide custom image decoding/encoding. + These methods are all required to implement. + @note Pay attention that these methods are not called from main queue. + */ +@protocol SDWebImageCoder + +@required +#pragma mark - Decoding +/** + Returns YES if this coder can decode some data. Otherwise, the data should be passed to another coder. + + @param data The image data so we can look at it + @return YES if this coder can decode the data, NO otherwise + */ +- (BOOL)canDecodeFromData:(nullable NSData *)data; + +/** + Decode the image data to image. + + @param data The image data to be decoded + @return The decoded image from data + */ +- (nullable UIImage *)decodedImageWithData:(nullable NSData *)data; + +/** + Decompress the image with original image and image data. + + @param image The original image to be decompressed + @param data The pointer to original image data. The pointer itself is nonnull but image data can be null. This data will set to cache if needed. If you do not need to modify data at the sametime, ignore this param. + @param optionsDict A dictionary containing any decompressing options. Pass {SDWebImageCoderScaleDownLargeImagesKey: @(YES)} to scale down large images + @return The decompressed image + */ +- (nullable UIImage *)decompressedImageWithImage:(nullable UIImage *)image + data:(NSData * _Nullable * _Nonnull)data + options:(nullable NSDictionary*)optionsDict; + +#pragma mark - Encoding + +/** + Returns YES if this coder can encode some image. Otherwise, it should be passed to another coder. + + @param format The image format + @return YES if this coder can encode the image, NO otherwise + */ +- (BOOL)canEncodeToFormat:(SDImageFormat)format; + +/** + Encode the image to image data. + + @param image The image to be encoded + @param format The image format to encode, you should note `SDImageFormatUndefined` format is also possible + @return The encoded image data + */ +- (nullable NSData *)encodedDataWithImage:(nullable UIImage *)image format:(SDImageFormat)format; + +@end + + +/** + This is the image coder protocol to provide custom progressive image decoding. + These methods are all required to implement. + @note Pay attention that these methods are not called from main queue. + */ +@protocol SDWebImageProgressiveCoder + +@required +/** + Returns YES if this coder can incremental decode some data. Otherwise, it should be passed to another coder. + + @param data The image data so we can look at it + @return YES if this coder can decode the data, NO otherwise + */ +- (BOOL)canIncrementallyDecodeFromData:(nullable NSData *)data; + +/** + Incremental decode the image data to image. + + @param data The image data has been downloaded so far + @param finished Whether the download has finished + @warning because incremental decoding need to keep the decoded context, we will alloc a new instance with the same class for each download operation to avoid conflicts + @return The decoded image from data + */ +- (nullable UIImage *)incrementallyDecodedImageWithData:(nullable NSData *)data finished:(BOOL)finished; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageCoder.m b/client/Pods/SDWebImage/SDWebImage/SDWebImageCoder.m new file mode 100644 index 00000000..9357fe52 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageCoder.m @@ -0,0 +1,31 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCoder.h" + +NSString * const SDWebImageCoderScaleDownLargeImagesKey = @"scaleDownLargeImages"; + +CGColorSpaceRef SDCGColorSpaceGetDeviceRGB(void) { + static CGColorSpaceRef colorSpace; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + colorSpace = CGColorSpaceCreateDeviceRGB(); + }); + return colorSpace; +} + +BOOL SDCGImageRefContainsAlpha(CGImageRef imageRef) { + if (!imageRef) { + return NO; + } + CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef); + BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone || + alphaInfo == kCGImageAlphaNoneSkipFirst || + alphaInfo == kCGImageAlphaNoneSkipLast); + return hasAlpha; +} diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.h b/client/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.h new file mode 100644 index 00000000..cdafd88d --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.h @@ -0,0 +1,52 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" +#import "SDWebImageFrame.h" + +@interface SDWebImageCoderHelper : NSObject + +/** + Return an animated image with frames array. + For UIKit, this will apply the patch and then create animated UIImage. The patch is because that `+[UIImage animatedImageWithImages:duration:]` just use the averate of duration for each image. So it will not work if different frame has different duration. Therefore we repeat the specify frame for specify times to let it work. + For AppKit, NSImage does not support animates other than GIF. This will try to encode the frames to GIF format and then create an animated NSImage for rendering. + + @param frames The frames array. If no frames or frames is empty, return nil + @return A animated image for rendering on UIImageView(UIKit) or NSImageView(AppKit) + */ ++ (UIImage * _Nullable)animatedImageWithFrames:(NSArray * _Nullable)frames; + +/** + Return frames array from an animated image. + For UIKit, this will unapply the patch for the description above and then create frames array. This will also work for normal animated UIImage. + For AppKit, NSImage does not support animates other than GIF. This will try to decode the GIF imageRep and then create frames array. + + @param animatedImage A animated image. If it's not animated, return nil + @return The frames array + */ ++ (NSArray * _Nullable)framesFromAnimatedImage:(UIImage * _Nullable)animatedImage; + +#if SD_UIKIT || SD_WATCH +/** + Convert an EXIF image orientation to an iOS one. + + @param exifOrientation EXIF orientation + @return iOS orientation + */ ++ (UIImageOrientation)imageOrientationFromEXIFOrientation:(NSInteger)exifOrientation; +/** + Convert an iOS orientation to an EXIF image orientation. + + @param imageOrientation iOS orientation + @return EXIF orientation + */ ++ (NSInteger)exifOrientationFromImageOrientation:(UIImageOrientation)imageOrientation; +#endif + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.m b/client/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.m new file mode 100644 index 00000000..b2b651a2 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.m @@ -0,0 +1,255 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCoderHelper.h" +#import "SDWebImageFrame.h" +#import "UIImage+MultiFormat.h" +#import "NSImage+WebCache.h" +#import + +@implementation SDWebImageCoderHelper + ++ (UIImage *)animatedImageWithFrames:(NSArray *)frames { + NSUInteger frameCount = frames.count; + if (frameCount == 0) { + return nil; + } + + UIImage *animatedImage; + +#if SD_UIKIT || SD_WATCH + NSUInteger durations[frameCount]; + for (size_t i = 0; i < frameCount; i++) { + durations[i] = frames[i].duration * 1000; + } + NSUInteger const gcd = gcdArray(frameCount, durations); + __block NSUInteger totalDuration = 0; + NSMutableArray *animatedImages = [NSMutableArray arrayWithCapacity:frameCount]; + [frames enumerateObjectsUsingBlock:^(SDWebImageFrame * _Nonnull frame, NSUInteger idx, BOOL * _Nonnull stop) { + UIImage *image = frame.image; + NSUInteger duration = frame.duration * 1000; + totalDuration += duration; + NSUInteger repeatCount; + if (gcd) { + repeatCount = duration / gcd; + } else { + repeatCount = 1; + } + for (size_t i = 0; i < repeatCount; ++i) { + [animatedImages addObject:image]; + } + }]; + + animatedImage = [UIImage animatedImageWithImages:animatedImages duration:totalDuration / 1000.f]; + +#else + + NSMutableData *imageData = [NSMutableData data]; + CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatGIF]; + // Create an image destination. GIF does not support EXIF image orientation + CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, frameCount, NULL); + if (!imageDestination) { + // Handle failure. + return nil; + } + + for (size_t i = 0; i < frameCount; i++) { + @autoreleasepool { + SDWebImageFrame *frame = frames[i]; + float frameDuration = frame.duration; + CGImageRef frameImageRef = frame.image.CGImage; + NSDictionary *frameProperties = @{(__bridge_transfer NSString *)kCGImagePropertyGIFDictionary : @{(__bridge_transfer NSString *)kCGImagePropertyGIFUnclampedDelayTime : @(frameDuration)}}; + CGImageDestinationAddImage(imageDestination, frameImageRef, (__bridge CFDictionaryRef)frameProperties); + } + } + // Finalize the destination. + if (CGImageDestinationFinalize(imageDestination) == NO) { + // Handle failure. + CFRelease(imageDestination); + return nil; + } + CFRelease(imageDestination); + animatedImage = [[NSImage alloc] initWithData:imageData]; +#endif + + return animatedImage; +} + ++ (NSArray *)framesFromAnimatedImage:(UIImage *)animatedImage { + if (!animatedImage) { + return nil; + } + + NSMutableArray *frames = [NSMutableArray array]; + NSUInteger frameCount = 0; + +#if SD_UIKIT || SD_WATCH + NSArray *animatedImages = animatedImage.images; + frameCount = animatedImages.count; + if (frameCount == 0) { + return nil; + } + + NSTimeInterval avgDuration = animatedImage.duration / frameCount; + if (avgDuration == 0) { + avgDuration = 0.1; // if it's a animated image but no duration, set it to default 100ms (this do not have that 10ms limit like GIF or WebP to allow custom coder provide the limit) + } + + __block NSUInteger index = 0; + __block NSUInteger repeatCount = 1; + __block UIImage *previousImage = animatedImages.firstObject; + [animatedImages enumerateObjectsUsingBlock:^(UIImage * _Nonnull image, NSUInteger idx, BOOL * _Nonnull stop) { + // ignore first + if (idx == 0) { + return; + } + if ([image isEqual:previousImage]) { + repeatCount++; + } else { + SDWebImageFrame *frame = [SDWebImageFrame frameWithImage:previousImage duration:avgDuration * repeatCount]; + [frames addObject:frame]; + repeatCount = 1; + index++; + } + previousImage = image; + // last one + if (idx == frameCount - 1) { + SDWebImageFrame *frame = [SDWebImageFrame frameWithImage:previousImage duration:avgDuration * repeatCount]; + [frames addObject:frame]; + } + }]; + +#else + + NSBitmapImageRep *bitmapRep; + for (NSImageRep *imageRep in animatedImage.representations) { + if ([imageRep isKindOfClass:[NSBitmapImageRep class]]) { + bitmapRep = (NSBitmapImageRep *)imageRep; + break; + } + } + if (bitmapRep) { + frameCount = [[bitmapRep valueForProperty:NSImageFrameCount] unsignedIntegerValue]; + } + + if (frameCount == 0) { + return nil; + } + + for (size_t i = 0; i < frameCount; i++) { + @autoreleasepool { + // NSBitmapImageRep need to manually change frame. "Good taste" API + [bitmapRep setProperty:NSImageCurrentFrame withValue:@(i)]; + float frameDuration = [[bitmapRep valueForProperty:NSImageCurrentFrameDuration] floatValue]; + NSImage *frameImage = [[NSImage alloc] initWithCGImage:bitmapRep.CGImage size:CGSizeZero]; + SDWebImageFrame *frame = [SDWebImageFrame frameWithImage:frameImage duration:frameDuration]; + [frames addObject:frame]; + } + } +#endif + + return frames; +} + +#if SD_UIKIT || SD_WATCH +// Convert an EXIF image orientation to an iOS one. ++ (UIImageOrientation)imageOrientationFromEXIFOrientation:(NSInteger)exifOrientation { + // CGImagePropertyOrientation is available on iOS 8 above. Currently kept for compatibility + UIImageOrientation imageOrientation = UIImageOrientationUp; + switch (exifOrientation) { + case 1: + imageOrientation = UIImageOrientationUp; + break; + case 3: + imageOrientation = UIImageOrientationDown; + break; + case 8: + imageOrientation = UIImageOrientationLeft; + break; + case 6: + imageOrientation = UIImageOrientationRight; + break; + case 2: + imageOrientation = UIImageOrientationUpMirrored; + break; + case 4: + imageOrientation = UIImageOrientationDownMirrored; + break; + case 5: + imageOrientation = UIImageOrientationLeftMirrored; + break; + case 7: + imageOrientation = UIImageOrientationRightMirrored; + break; + default: + break; + } + return imageOrientation; +} + +// Convert an iOS orientation to an EXIF image orientation. ++ (NSInteger)exifOrientationFromImageOrientation:(UIImageOrientation)imageOrientation { + // CGImagePropertyOrientation is available on iOS 8 above. Currently kept for compatibility + NSInteger exifOrientation = 1; + switch (imageOrientation) { + case UIImageOrientationUp: + exifOrientation = 1; + break; + case UIImageOrientationDown: + exifOrientation = 3; + break; + case UIImageOrientationLeft: + exifOrientation = 8; + break; + case UIImageOrientationRight: + exifOrientation = 6; + break; + case UIImageOrientationUpMirrored: + exifOrientation = 2; + break; + case UIImageOrientationDownMirrored: + exifOrientation = 4; + break; + case UIImageOrientationLeftMirrored: + exifOrientation = 5; + break; + case UIImageOrientationRightMirrored: + exifOrientation = 7; + break; + default: + break; + } + return exifOrientation; +} +#endif + +#pragma mark - Helper Fuction +#if SD_UIKIT || SD_WATCH +static NSUInteger gcd(NSUInteger a, NSUInteger b) { + NSUInteger c; + while (a != 0) { + c = a; + a = b % a; + b = c; + } + return b; +} + +static NSUInteger gcdArray(size_t const count, NSUInteger const * const values) { + if (count == 0) { + return 0; + } + NSUInteger result = values[0]; + for (size_t i = 1; i < count; ++i) { + result = gcd(values[i], result); + } + return result; +} +#endif + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.h b/client/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.h new file mode 100644 index 00000000..5c3d4b37 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.h @@ -0,0 +1,58 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCoder.h" + +/** + Global object holding the array of coders, so that we avoid passing them from object to object. + Uses a priority queue behind scenes, which means the latest added coders have the highest priority. + This is done so when encoding/decoding something, we go through the list and ask each coder if they can handle the current data. + That way, users can add their custom coders while preserving our existing prebuilt ones + + Note: the `coders` getter will return the coders in their reversed order + Example: + - by default we internally set coders = `IOCoder`, `WebPCoder`. (`GIFCoder` is not recommended to add only if you want to get GIF support without `FLAnimatedImage`) + - calling `coders` will return `@[WebPCoder, IOCoder]` + - call `[addCoder:[MyCrazyCoder new]]` + - calling `coders` now returns `@[MyCrazyCoder, WebPCoder, IOCoder]` + + Coders + ------ + A coder must conform to the `SDWebImageCoder` protocol or even to `SDWebImageProgressiveCoder` if it supports progressive decoding + Conformance is important because that way, they will implement `canDecodeFromData` or `canEncodeToFormat` + Those methods are called on each coder in the array (using the priority order) until one of them returns YES. + That means that coder can decode that data / encode to that format + */ +@interface SDWebImageCodersManager : NSObject + +/** + Shared reusable instance + */ ++ (nonnull instancetype)sharedInstance; + +/** + All coders in coders manager. The coders array is a priority queue, which means the later added coder will have the highest priority + */ +@property (nonatomic, strong, readwrite, nullable) NSArray* coders; + +/** + Add a new coder to the end of coders array. Which has the highest priority. + + @param coder coder + */ +- (void)addCoder:(nonnull id)coder; + +/** + Remove a coder in the coders array. + + @param coder coder + */ +- (void)removeCoder:(nonnull id)coder; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.m b/client/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.m new file mode 100644 index 00000000..23bc4c42 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.m @@ -0,0 +1,137 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCodersManager.h" +#import "SDWebImageImageIOCoder.h" +#import "SDWebImageGIFCoder.h" +#ifdef SD_WEBP +#import "SDWebImageWebPCoder.h" +#endif + +@interface SDWebImageCodersManager () + +@property (nonatomic, strong, nonnull) NSMutableArray* mutableCoders; +@property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t mutableCodersAccessQueue; + +@end + +@implementation SDWebImageCodersManager + ++ (nonnull instancetype)sharedInstance { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (instancetype)init { + if (self = [super init]) { + // initialize with default coders + _mutableCoders = [@[[SDWebImageImageIOCoder sharedCoder]] mutableCopy]; +#ifdef SD_WEBP + [_mutableCoders addObject:[SDWebImageWebPCoder sharedCoder]]; +#endif + _mutableCodersAccessQueue = dispatch_queue_create("com.hackemist.SDWebImageCodersManager", DISPATCH_QUEUE_CONCURRENT); + } + return self; +} + +- (void)dealloc { + SDDispatchQueueRelease(_mutableCodersAccessQueue); +} + +#pragma mark - Coder IO operations + +- (void)addCoder:(nonnull id)coder { + if ([coder conformsToProtocol:@protocol(SDWebImageCoder)]) { + dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ + [self.mutableCoders addObject:coder]; + }); + } +} + +- (void)removeCoder:(nonnull id)coder { + dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ + [self.mutableCoders removeObject:coder]; + }); +} + +- (NSArray *)coders { + __block NSArray *sortedCoders = nil; + dispatch_sync(self.mutableCodersAccessQueue, ^{ + sortedCoders = (NSArray *)[[[self.mutableCoders copy] reverseObjectEnumerator] allObjects]; + }); + return sortedCoders; +} + +- (void)setCoders:(NSArray *)coders { + dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ + self.mutableCoders = [coders mutableCopy]; + }); +} + +#pragma mark - SDWebImageCoder +- (BOOL)canDecodeFromData:(NSData *)data { + for (id coder in self.coders) { + if ([coder canDecodeFromData:data]) { + return YES; + } + } + return NO; +} + +- (BOOL)canEncodeToFormat:(SDImageFormat)format { + for (id coder in self.coders) { + if ([coder canEncodeToFormat:format]) { + return YES; + } + } + return NO; +} + +- (UIImage *)decodedImageWithData:(NSData *)data { + if (!data) { + return nil; + } + for (id coder in self.coders) { + if ([coder canDecodeFromData:data]) { + return [coder decodedImageWithData:data]; + } + } + return nil; +} + +- (UIImage *)decompressedImageWithImage:(UIImage *)image + data:(NSData *__autoreleasing _Nullable *)data + options:(nullable NSDictionary*)optionsDict { + if (!image) { + return nil; + } + for (id coder in self.coders) { + if ([coder canDecodeFromData:*data]) { + return [coder decompressedImageWithImage:image data:data options:optionsDict]; + } + } + return nil; +} + +- (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format { + if (!image) { + return nil; + } + for (id coder in self.coders) { + if ([coder canEncodeToFormat:format]) { + return [coder encodedDataWithImage:image format:format]; + } + } + return nil; +} + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h b/client/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h new file mode 100644 index 00000000..2a6caa38 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h @@ -0,0 +1,113 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * (c) Jamie Pinkham + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import + +#ifdef __OBJC_GC__ + #error SDWebImage does not support Objective-C Garbage Collection +#endif + +// Apple's defines from TargetConditionals.h are a bit weird. +// Seems like TARGET_OS_MAC is always defined (on all platforms). +// To determine if we are running on OSX, we can only rely on TARGET_OS_IPHONE=0 and all the other platforms +#if !TARGET_OS_IPHONE && !TARGET_OS_IOS && !TARGET_OS_TV && !TARGET_OS_WATCH + #define SD_MAC 1 +#else + #define SD_MAC 0 +#endif + +// iOS and tvOS are very similar, UIKit exists on both platforms +// Note: watchOS also has UIKit, but it's very limited +#if TARGET_OS_IOS || TARGET_OS_TV + #define SD_UIKIT 1 +#else + #define SD_UIKIT 0 +#endif + +#if TARGET_OS_IOS + #define SD_IOS 1 +#else + #define SD_IOS 0 +#endif + +#if TARGET_OS_TV + #define SD_TV 1 +#else + #define SD_TV 0 +#endif + +#if TARGET_OS_WATCH + #define SD_WATCH 1 +#else + #define SD_WATCH 0 +#endif + + +#if SD_MAC + #import + #ifndef UIImage + #define UIImage NSImage + #endif + #ifndef UIImageView + #define UIImageView NSImageView + #endif + #ifndef UIView + #define UIView NSView + #endif +#else + #if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 + #error SDWebImage doesn't support Deployment Target version < 5.0 + #endif + + #if SD_UIKIT + #import + #endif + #if SD_WATCH + #import + #endif +#endif + +#ifndef NS_ENUM +#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type +#endif + +#ifndef NS_OPTIONS +#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type +#endif + +#if OS_OBJECT_USE_OBJC + #undef SDDispatchQueueRelease + #undef SDDispatchQueueSetterSementics + #define SDDispatchQueueRelease(q) + #define SDDispatchQueueSetterSementics strong +#else + #undef SDDispatchQueueRelease + #undef SDDispatchQueueSetterSementics + #define SDDispatchQueueRelease(q) (dispatch_release(q)) + #define SDDispatchQueueSetterSementics assign +#endif + +FOUNDATION_EXPORT UIImage *SDScaledImageForKey(NSString *key, UIImage *image); + +typedef void(^SDWebImageNoParamsBlock)(void); + +FOUNDATION_EXPORT NSString *const SDWebImageErrorDomain; + +#ifndef dispatch_queue_async_safe +#define dispatch_queue_async_safe(queue, block)\ + if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(queue)) == 0) {\ + block();\ + } else {\ + dispatch_async(queue, block);\ + } +#endif + +#ifndef dispatch_main_async_safe +#define dispatch_main_async_safe(block) dispatch_queue_async_safe(dispatch_get_main_queue(), block) +#endif diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m b/client/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m new file mode 100644 index 00000000..d49334d2 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m @@ -0,0 +1,63 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" +#import "UIImage+MultiFormat.h" + +#if !__has_feature(objc_arc) +#error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag +#endif + +inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) { + if (!image) { + return nil; + } + +#if SD_MAC + return image; +#elif SD_UIKIT || SD_WATCH + if ((image.images).count > 0) { + NSMutableArray *scaledImages = [NSMutableArray array]; + + for (UIImage *tempImage in image.images) { + [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; + } + + UIImage *animatedImage = [UIImage animatedImageWithImages:scaledImages duration:image.duration]; + if (animatedImage) { + animatedImage.sd_imageLoopCount = image.sd_imageLoopCount; + } + return animatedImage; + } else { +#if SD_WATCH + if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) { +#elif SD_UIKIT + if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { +#endif + CGFloat scale = 1; + if (key.length >= 8) { + NSRange range = [key rangeOfString:@"@2x."]; + if (range.location != NSNotFound) { + scale = 2.0; + } + + range = [key rangeOfString:@"@3x."]; + if (range.location != NSNotFound) { + scale = 3.0; + } + } + + UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; + image = scaledImage; + } + return image; + } +#endif +} + +NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h b/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h new file mode 100644 index 00000000..808b0bc1 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h @@ -0,0 +1,249 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" +#import "SDWebImageOperation.h" + +typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) { + SDWebImageDownloaderLowPriority = 1 << 0, + SDWebImageDownloaderProgressiveDownload = 1 << 1, + + /** + * By default, request prevent the use of NSURLCache. With this flag, NSURLCache + * is used with default policies. + */ + SDWebImageDownloaderUseNSURLCache = 1 << 2, + + /** + * Call completion block with nil image/imageData if the image was read from NSURLCache + * (to be combined with `SDWebImageDownloaderUseNSURLCache`). + */ + SDWebImageDownloaderIgnoreCachedResponse = 1 << 3, + + /** + * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for + * extra time in background to let the request finish. If the background task expires the operation will be cancelled. + */ + SDWebImageDownloaderContinueInBackground = 1 << 4, + + /** + * Handles cookies stored in NSHTTPCookieStore by setting + * NSMutableURLRequest.HTTPShouldHandleCookies = YES; + */ + SDWebImageDownloaderHandleCookies = 1 << 5, + + /** + * Enable to allow untrusted SSL certificates. + * Useful for testing purposes. Use with caution in production. + */ + SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6, + + /** + * Put the image in the high priority queue. + */ + SDWebImageDownloaderHighPriority = 1 << 7, + + /** + * Scale down the image + */ + SDWebImageDownloaderScaleDownLargeImages = 1 << 8, +}; + +typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) { + /** + * Default value. All download operations will execute in queue style (first-in-first-out). + */ + SDWebImageDownloaderFIFOExecutionOrder, + + /** + * All download operations will execute in stack style (last-in-first-out). + */ + SDWebImageDownloaderLIFOExecutionOrder +}; + +FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStartNotification; +FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStopNotification; + +typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL); + +typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished); + +typedef NSDictionary SDHTTPHeadersDictionary; +typedef NSMutableDictionary SDHTTPHeadersMutableDictionary; + +typedef SDHTTPHeadersDictionary * _Nullable (^SDWebImageDownloaderHeadersFilterBlock)(NSURL * _Nullable url, SDHTTPHeadersDictionary * _Nullable headers); + +/** + * A token associated with each download. Can be used to cancel a download + */ +@interface SDWebImageDownloadToken : NSObject + +@property (nonatomic, strong, nullable) NSURL *url; +@property (nonatomic, strong, nullable) id downloadOperationCancelToken; + +@end + + +/** + * Asynchronous downloader dedicated and optimized for image loading. + */ +@interface SDWebImageDownloader : NSObject + +/** + * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. + * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. + */ +@property (assign, nonatomic) BOOL shouldDecompressImages; + +/** + * The maximum number of concurrent downloads + */ +@property (assign, nonatomic) NSInteger maxConcurrentDownloads; + +/** + * Shows the current amount of downloads that still need to be downloaded + */ +@property (readonly, nonatomic) NSUInteger currentDownloadCount; + +/** + * The timeout value (in seconds) for the download operation. Default: 15.0. + */ +@property (assign, nonatomic) NSTimeInterval downloadTimeout; + +/** + * The configuration in use by the internal NSURLSession. + * Mutating this object directly has no effect. + * + * @see createNewSessionWithConfiguration: + */ +@property (readonly, nonatomic, nonnull) NSURLSessionConfiguration *sessionConfiguration; + + +/** + * Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`. + */ +@property (assign, nonatomic) SDWebImageDownloaderExecutionOrder executionOrder; + +/** + * Singleton method, returns the shared instance + * + * @return global shared instance of downloader class + */ ++ (nonnull instancetype)sharedDownloader; + +/** + * Set the default URL credential to be set for request operations. + */ +@property (strong, nonatomic, nullable) NSURLCredential *urlCredential; + +/** + * Set username + */ +@property (strong, nonatomic, nullable) NSString *username; + +/** + * Set password + */ +@property (strong, nonatomic, nullable) NSString *password; + +/** + * Set filter to pick headers for downloading image HTTP request. + * + * This block will be invoked for each downloading image request, returned + * NSDictionary will be used as headers in corresponding HTTP request. + */ +@property (nonatomic, copy, nullable) SDWebImageDownloaderHeadersFilterBlock headersFilter; + +/** + * Creates an instance of a downloader with specified session configuration. + * *Note*: `timeoutIntervalForRequest` is going to be overwritten. + * @return new instance of downloader class + */ +- (nonnull instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)sessionConfiguration NS_DESIGNATED_INITIALIZER; + +/** + * Set a value for a HTTP header to be appended to each download HTTP request. + * + * @param value The value for the header field. Use `nil` value to remove the header. + * @param field The name of the header field to set. + */ +- (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field; + +/** + * Returns the value of the specified HTTP header field. + * + * @return The value associated with the header field field, or `nil` if there is no corresponding header field. + */ +- (nullable NSString *)valueForHTTPHeaderField:(nullable NSString *)field; + +/** + * Sets a subclass of `SDWebImageDownloaderOperation` as the default + * `NSOperation` to be used each time SDWebImage constructs a request + * operation to download an image. + * + * @param operationClass The subclass of `SDWebImageDownloaderOperation` to set + * as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`. + */ +- (void)setOperationClass:(nullable Class)operationClass; + +/** + * Creates a SDWebImageDownloader async downloader instance with a given URL + * + * The delegate will be informed when the image is finish downloaded or an error has happen. + * + * @see SDWebImageDownloaderDelegate + * + * @param url The URL to the image to download + * @param options The options to be used for this download + * @param progressBlock A block called repeatedly while the image is downloading + * @note the progress block is executed on a background queue + * @param completedBlock A block called once the download is completed. + * If the download succeeded, the image parameter is set, in case of error, + * error parameter is set with the error. The last parameter is always YES + * if SDWebImageDownloaderProgressiveDownload isn't use. With the + * SDWebImageDownloaderProgressiveDownload option, this block is called + * repeatedly with the partial image object and the finished argument set to NO + * before to be called a last time with the full image and finished argument + * set to YES. In case of error, the finished argument is always YES. + * + * @return A token (SDWebImageDownloadToken) that can be passed to -cancel: to cancel this operation + */ +- (nullable SDWebImageDownloadToken *)downloadImageWithURL:(nullable NSURL *)url + options:(SDWebImageDownloaderOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; + +/** + * Cancels a download that was previously queued using -downloadImageWithURL:options:progress:completed: + * + * @param token The token received from -downloadImageWithURL:options:progress:completed: that should be canceled. + */ +- (void)cancel:(nullable SDWebImageDownloadToken *)token; + +/** + * Sets the download queue suspension state + */ +- (void)setSuspended:(BOOL)suspended; + +/** + * Cancels all download operations in the queue + */ +- (void)cancelAllDownloads; + +/** + * Forces SDWebImageDownloader to create and use a new NSURLSession that is + * initialized with the given configuration. + * *Note*: All existing download operations in the queue will be cancelled. + * *Note*: `timeoutIntervalForRequest` is going to be overwritten. + * + * @param sessionConfiguration The configuration to use for the new NSURLSession + */ +- (void)createNewSessionWithConfiguration:(nonnull NSURLSessionConfiguration *)sessionConfiguration; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m b/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m new file mode 100644 index 00000000..24e5e0d6 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m @@ -0,0 +1,333 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageDownloader.h" +#import "SDWebImageDownloaderOperation.h" + +@implementation SDWebImageDownloadToken +@end + + +@interface SDWebImageDownloader () + +@property (strong, nonatomic, nonnull) NSOperationQueue *downloadQueue; +@property (weak, nonatomic, nullable) NSOperation *lastAddedOperation; +@property (assign, nonatomic, nullable) Class operationClass; +@property (strong, nonatomic, nonnull) NSMutableDictionary *URLOperations; +@property (strong, nonatomic, nullable) SDHTTPHeadersMutableDictionary *HTTPHeaders; +// This queue is used to serialize the handling of the network responses of all the download operation in a single queue +@property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t barrierQueue; + +// The session in which data tasks will run +@property (strong, nonatomic) NSURLSession *session; + +@end + +@implementation SDWebImageDownloader + ++ (void)initialize { + // Bind SDNetworkActivityIndicator if available (download it here: http://github.com/rs/SDNetworkActivityIndicator ) + // To use it, just add #import "SDNetworkActivityIndicator.h" in addition to the SDWebImage import + if (NSClassFromString(@"SDNetworkActivityIndicator")) { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + id activityIndicator = [NSClassFromString(@"SDNetworkActivityIndicator") performSelector:NSSelectorFromString(@"sharedActivityIndicator")]; +#pragma clang diagnostic pop + + // Remove observer in case it was previously added. + [[NSNotificationCenter defaultCenter] removeObserver:activityIndicator name:SDWebImageDownloadStartNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:activityIndicator name:SDWebImageDownloadStopNotification object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:activityIndicator + selector:NSSelectorFromString(@"startActivity") + name:SDWebImageDownloadStartNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:activityIndicator + selector:NSSelectorFromString(@"stopActivity") + name:SDWebImageDownloadStopNotification object:nil]; + } +} + ++ (nonnull instancetype)sharedDownloader { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (nonnull instancetype)init { + return [self initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; +} + +- (nonnull instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)sessionConfiguration { + if ((self = [super init])) { + _operationClass = [SDWebImageDownloaderOperation class]; + _shouldDecompressImages = YES; + _executionOrder = SDWebImageDownloaderFIFOExecutionOrder; + _downloadQueue = [NSOperationQueue new]; + _downloadQueue.maxConcurrentOperationCount = 6; + _downloadQueue.name = @"com.hackemist.SDWebImageDownloader"; + _URLOperations = [NSMutableDictionary new]; +#ifdef SD_WEBP + _HTTPHeaders = [@{@"Accept": @"image/webp,image/*;q=0.8"} mutableCopy]; +#else + _HTTPHeaders = [@{@"Accept": @"image/*;q=0.8"} mutableCopy]; +#endif + _barrierQueue = dispatch_queue_create("com.hackemist.SDWebImageDownloaderBarrierQueue", DISPATCH_QUEUE_CONCURRENT); + _downloadTimeout = 15.0; + + [self createNewSessionWithConfiguration:sessionConfiguration]; + } + return self; +} + +- (void)createNewSessionWithConfiguration:(NSURLSessionConfiguration *)sessionConfiguration { + [self cancelAllDownloads]; + + if (self.session) { + [self.session invalidateAndCancel]; + } + + sessionConfiguration.timeoutIntervalForRequest = self.downloadTimeout; + + /** + * Create the session for this task + * We send nil as delegate queue so that the session creates a serial operation queue for performing all delegate + * method calls and completion handler calls. + */ + self.session = [NSURLSession sessionWithConfiguration:sessionConfiguration + delegate:self + delegateQueue:nil]; +} + +- (void)dealloc { + [self.session invalidateAndCancel]; + self.session = nil; + + [self.downloadQueue cancelAllOperations]; + SDDispatchQueueRelease(_barrierQueue); +} + +- (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field { + if (value) { + self.HTTPHeaders[field] = value; + } else { + [self.HTTPHeaders removeObjectForKey:field]; + } +} + +- (nullable NSString *)valueForHTTPHeaderField:(nullable NSString *)field { + return self.HTTPHeaders[field]; +} + +- (void)setMaxConcurrentDownloads:(NSInteger)maxConcurrentDownloads { + _downloadQueue.maxConcurrentOperationCount = maxConcurrentDownloads; +} + +- (NSUInteger)currentDownloadCount { + return _downloadQueue.operationCount; +} + +- (NSInteger)maxConcurrentDownloads { + return _downloadQueue.maxConcurrentOperationCount; +} + +- (NSURLSessionConfiguration *)sessionConfiguration { + return self.session.configuration; +} + +- (void)setOperationClass:(nullable Class)operationClass { + if (operationClass && [operationClass isSubclassOfClass:[NSOperation class]] && [operationClass conformsToProtocol:@protocol(SDWebImageDownloaderOperationInterface)]) { + _operationClass = operationClass; + } else { + _operationClass = [SDWebImageDownloaderOperation class]; + } +} + +- (nullable SDWebImageDownloadToken *)downloadImageWithURL:(nullable NSURL *)url + options:(SDWebImageDownloaderOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock { + __weak SDWebImageDownloader *wself = self; + + return [self addProgressCallback:progressBlock completedBlock:completedBlock forURL:url createCallback:^SDWebImageDownloaderOperation *{ + __strong __typeof (wself) sself = wself; + NSTimeInterval timeoutInterval = sself.downloadTimeout; + if (timeoutInterval == 0.0) { + timeoutInterval = 15.0; + } + + // In order to prevent from potential duplicate caching (NSURLCache + SDImageCache) we disable the cache for image requests if told otherwise + NSURLRequestCachePolicy cachePolicy = options & SDWebImageDownloaderUseNSURLCache ? NSURLRequestUseProtocolCachePolicy : NSURLRequestReloadIgnoringLocalCacheData; + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url + cachePolicy:cachePolicy + timeoutInterval:timeoutInterval]; + + request.HTTPShouldHandleCookies = (options & SDWebImageDownloaderHandleCookies); + request.HTTPShouldUsePipelining = YES; + if (sself.headersFilter) { + request.allHTTPHeaderFields = sself.headersFilter(url, [sself.HTTPHeaders copy]); + } + else { + request.allHTTPHeaderFields = sself.HTTPHeaders; + } + SDWebImageDownloaderOperation *operation = [[sself.operationClass alloc] initWithRequest:request inSession:sself.session options:options]; + operation.shouldDecompressImages = sself.shouldDecompressImages; + + if (sself.urlCredential) { + operation.credential = sself.urlCredential; + } else if (sself.username && sself.password) { + operation.credential = [NSURLCredential credentialWithUser:sself.username password:sself.password persistence:NSURLCredentialPersistenceForSession]; + } + + if (options & SDWebImageDownloaderHighPriority) { + operation.queuePriority = NSOperationQueuePriorityHigh; + } else if (options & SDWebImageDownloaderLowPriority) { + operation.queuePriority = NSOperationQueuePriorityLow; + } + + [sself.downloadQueue addOperation:operation]; + if (sself.executionOrder == SDWebImageDownloaderLIFOExecutionOrder) { + // Emulate LIFO execution order by systematically adding new operations as last operation's dependency + [sself.lastAddedOperation addDependency:operation]; + sself.lastAddedOperation = operation; + } + + return operation; + }]; +} + +- (void)cancel:(nullable SDWebImageDownloadToken *)token { + dispatch_barrier_async(self.barrierQueue, ^{ + SDWebImageDownloaderOperation *operation = self.URLOperations[token.url]; + BOOL canceled = [operation cancel:token.downloadOperationCancelToken]; + if (canceled) { + [self.URLOperations removeObjectForKey:token.url]; + } + }); +} + +- (nullable SDWebImageDownloadToken *)addProgressCallback:(SDWebImageDownloaderProgressBlock)progressBlock + completedBlock:(SDWebImageDownloaderCompletedBlock)completedBlock + forURL:(nullable NSURL *)url + createCallback:(SDWebImageDownloaderOperation *(^)(void))createCallback { + // The URL will be used as the key to the callbacks dictionary so it cannot be nil. If it is nil immediately call the completed block with no image or data. + if (url == nil) { + if (completedBlock != nil) { + completedBlock(nil, nil, nil, NO); + } + return nil; + } + + __block SDWebImageDownloadToken *token = nil; + + dispatch_barrier_sync(self.barrierQueue, ^{ + SDWebImageDownloaderOperation *operation = self.URLOperations[url]; + if (!operation) { + operation = createCallback(); + self.URLOperations[url] = operation; + + __weak SDWebImageDownloaderOperation *woperation = operation; + operation.completionBlock = ^{ + dispatch_barrier_sync(self.barrierQueue, ^{ + SDWebImageDownloaderOperation *soperation = woperation; + if (!soperation) return; + if (self.URLOperations[url] == soperation) { + [self.URLOperations removeObjectForKey:url]; + }; + }); + }; + } + id downloadOperationCancelToken = [operation addHandlersForProgress:progressBlock completed:completedBlock]; + + token = [SDWebImageDownloadToken new]; + token.url = url; + token.downloadOperationCancelToken = downloadOperationCancelToken; + }); + + return token; +} + +- (void)setSuspended:(BOOL)suspended { + self.downloadQueue.suspended = suspended; +} + +- (void)cancelAllDownloads { + [self.downloadQueue cancelAllOperations]; +} + +#pragma mark Helper methods + +- (SDWebImageDownloaderOperation *)operationWithTask:(NSURLSessionTask *)task { + SDWebImageDownloaderOperation *returnOperation = nil; + for (SDWebImageDownloaderOperation *operation in self.downloadQueue.operations) { + if (operation.dataTask.taskIdentifier == task.taskIdentifier) { + returnOperation = operation; + break; + } + } + return returnOperation; +} + +#pragma mark NSURLSessionDataDelegate + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask +didReceiveResponse:(NSURLResponse *)response + completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler { + + // Identify the operation that runs this task and pass it the delegate method + SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:dataTask]; + + [dataOperation URLSession:session dataTask:dataTask didReceiveResponse:response completionHandler:completionHandler]; +} + +- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data { + + // Identify the operation that runs this task and pass it the delegate method + SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:dataTask]; + + [dataOperation URLSession:session dataTask:dataTask didReceiveData:data]; +} + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask + willCacheResponse:(NSCachedURLResponse *)proposedResponse + completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler { + + // Identify the operation that runs this task and pass it the delegate method + SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:dataTask]; + + [dataOperation URLSession:session dataTask:dataTask willCacheResponse:proposedResponse completionHandler:completionHandler]; +} + +#pragma mark NSURLSessionTaskDelegate + +- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { + // Identify the operation that runs this task and pass it the delegate method + SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:task]; + + [dataOperation URLSession:session task:task didCompleteWithError:error]; +} + +- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest * _Nullable))completionHandler { + + completionHandler(request); +} + +- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler { + + // Identify the operation that runs this task and pass it the delegate method + SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:task]; + + [dataOperation URLSession:session task:task didReceiveChallenge:challenge completionHandler:completionHandler]; +} + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h b/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h new file mode 100644 index 00000000..40721b24 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h @@ -0,0 +1,122 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageDownloader.h" +#import "SDWebImageOperation.h" + +FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStartNotification; +FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadReceiveResponseNotification; +FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStopNotification; +FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadFinishNotification; + + + +/** + Describes a downloader operation. If one wants to use a custom downloader op, it needs to inherit from `NSOperation` and conform to this protocol + */ +@protocol SDWebImageDownloaderOperationInterface + +- (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request + inSession:(nullable NSURLSession *)session + options:(SDWebImageDownloaderOptions)options; + +- (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; + +- (BOOL)shouldDecompressImages; +- (void)setShouldDecompressImages:(BOOL)value; + +- (nullable NSURLCredential *)credential; +- (void)setCredential:(nullable NSURLCredential *)value; + +@end + + +@interface SDWebImageDownloaderOperation : NSOperation + +/** + * The request used by the operation's task. + */ +@property (strong, nonatomic, readonly, nullable) NSURLRequest *request; + +/** + * The operation's task + */ +@property (strong, nonatomic, readonly, nullable) NSURLSessionTask *dataTask; + + +@property (assign, nonatomic) BOOL shouldDecompressImages; + +/** + * Was used to determine whether the URL connection should consult the credential storage for authenticating the connection. + * @deprecated Not used for a couple of versions + */ +@property (nonatomic, assign) BOOL shouldUseCredentialStorage __deprecated_msg("Property deprecated. Does nothing. Kept only for backwards compatibility"); + +/** + * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. + * + * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. + */ +@property (nonatomic, strong, nullable) NSURLCredential *credential; + +/** + * The SDWebImageDownloaderOptions for the receiver. + */ +@property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; + +/** + * The expected size of data. + */ +@property (assign, nonatomic) NSInteger expectedSize; + +/** + * The response returned by the operation's connection. + */ +@property (strong, nonatomic, nullable) NSURLResponse *response; + +/** + * Initializes a `SDWebImageDownloaderOperation` object + * + * @see SDWebImageDownloaderOperation + * + * @param request the URL request + * @param session the URL session in which this operation will run + * @param options downloader options + * + * @return the initialized instance + */ +- (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request + inSession:(nullable NSURLSession *)session + options:(SDWebImageDownloaderOptions)options NS_DESIGNATED_INITIALIZER; + +/** + * Adds handlers for progress and completion. Returns a tokent that can be passed to -cancel: to cancel this set of + * callbacks. + * + * @param progressBlock the block executed when a new chunk of data arrives. + * @note the progress block is executed on a background queue + * @param completedBlock the block executed when the download is done. + * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue + * + * @return the token to use to cancel this set of handlers + */ +- (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; + +/** + * Cancels a set of callbacks. Once all callbacks are canceled, the operation is cancelled. + * + * @param token the token representing a set of callbacks to cancel + * + * @return YES if the operation was stopped because this was the last token to be canceled. NO otherwise. + */ +- (BOOL)cancel:(nullable id)token; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m b/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m new file mode 100644 index 00000000..479c6b0a --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m @@ -0,0 +1,495 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageDownloaderOperation.h" +#import "SDWebImageManager.h" +#import "NSImage+WebCache.h" +#import "SDWebImageCodersManager.h" + +NSString *const SDWebImageDownloadStartNotification = @"SDWebImageDownloadStartNotification"; +NSString *const SDWebImageDownloadReceiveResponseNotification = @"SDWebImageDownloadReceiveResponseNotification"; +NSString *const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNotification"; +NSString *const SDWebImageDownloadFinishNotification = @"SDWebImageDownloadFinishNotification"; + +static NSString *const kProgressCallbackKey = @"progress"; +static NSString *const kCompletedCallbackKey = @"completed"; + +typedef NSMutableDictionary SDCallbacksDictionary; + +@interface SDWebImageDownloaderOperation () + +@property (strong, nonatomic, nonnull) NSMutableArray *callbackBlocks; + +@property (assign, nonatomic, getter = isExecuting) BOOL executing; +@property (assign, nonatomic, getter = isFinished) BOOL finished; +@property (strong, nonatomic, nullable) NSMutableData *imageData; +@property (copy, nonatomic, nullable) NSData *cachedData; + +// This is weak because it is injected by whoever manages this session. If this gets nil-ed out, we won't be able to run +// the task associated with this operation +@property (weak, nonatomic, nullable) NSURLSession *unownedSession; +// This is set if we're using not using an injected NSURLSession. We're responsible of invalidating this one +@property (strong, nonatomic, nullable) NSURLSession *ownedSession; + +@property (strong, nonatomic, readwrite, nullable) NSURLSessionTask *dataTask; + +@property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t barrierQueue; + +#if SD_UIKIT +@property (assign, nonatomic) UIBackgroundTaskIdentifier backgroundTaskId; +#endif + +@property (strong, nonatomic, nullable) id progressiveCoder; + +@end + +@implementation SDWebImageDownloaderOperation + +@synthesize executing = _executing; +@synthesize finished = _finished; + +- (nonnull instancetype)init { + return [self initWithRequest:nil inSession:nil options:0]; +} + +- (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request + inSession:(nullable NSURLSession *)session + options:(SDWebImageDownloaderOptions)options { + if ((self = [super init])) { + _request = [request copy]; + _shouldDecompressImages = YES; + _options = options; + _callbackBlocks = [NSMutableArray new]; + _executing = NO; + _finished = NO; + _expectedSize = 0; + _unownedSession = session; + _barrierQueue = dispatch_queue_create("com.hackemist.SDWebImageDownloaderOperationBarrierQueue", DISPATCH_QUEUE_CONCURRENT); + } + return self; +} + +- (void)dealloc { + SDDispatchQueueRelease(_barrierQueue); +} + +- (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock { + SDCallbacksDictionary *callbacks = [NSMutableDictionary new]; + if (progressBlock) callbacks[kProgressCallbackKey] = [progressBlock copy]; + if (completedBlock) callbacks[kCompletedCallbackKey] = [completedBlock copy]; + dispatch_barrier_async(self.barrierQueue, ^{ + [self.callbackBlocks addObject:callbacks]; + }); + return callbacks; +} + +- (nullable NSArray *)callbacksForKey:(NSString *)key { + __block NSMutableArray *callbacks = nil; + dispatch_sync(self.barrierQueue, ^{ + // We need to remove [NSNull null] because there might not always be a progress block for each callback + callbacks = [[self.callbackBlocks valueForKey:key] mutableCopy]; + [callbacks removeObjectIdenticalTo:[NSNull null]]; + }); + return [callbacks copy]; // strip mutability here +} + +- (BOOL)cancel:(nullable id)token { + __block BOOL shouldCancel = NO; + dispatch_barrier_sync(self.barrierQueue, ^{ + [self.callbackBlocks removeObjectIdenticalTo:token]; + if (self.callbackBlocks.count == 0) { + shouldCancel = YES; + } + }); + if (shouldCancel) { + [self cancel]; + } + return shouldCancel; +} + +- (void)start { + @synchronized (self) { + if (self.isCancelled) { + self.finished = YES; + [self reset]; + return; + } + +#if SD_UIKIT + Class UIApplicationClass = NSClassFromString(@"UIApplication"); + BOOL hasApplication = UIApplicationClass && [UIApplicationClass respondsToSelector:@selector(sharedApplication)]; + if (hasApplication && [self shouldContinueWhenAppEntersBackground]) { + __weak __typeof__ (self) wself = self; + UIApplication * app = [UIApplicationClass performSelector:@selector(sharedApplication)]; + self.backgroundTaskId = [app beginBackgroundTaskWithExpirationHandler:^{ + __strong __typeof (wself) sself = wself; + + if (sself) { + [sself cancel]; + + [app endBackgroundTask:sself.backgroundTaskId]; + sself.backgroundTaskId = UIBackgroundTaskInvalid; + } + }]; + } +#endif + if (self.options & SDWebImageDownloaderIgnoreCachedResponse) { + // Grab the cached data for later check + NSCachedURLResponse *cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:self.request]; + if (cachedResponse) { + self.cachedData = cachedResponse.data; + } + } + + NSURLSession *session = self.unownedSession; + if (!self.unownedSession) { + NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; + sessionConfig.timeoutIntervalForRequest = 15; + + /** + * Create the session for this task + * We send nil as delegate queue so that the session creates a serial operation queue for performing all delegate + * method calls and completion handler calls. + */ + self.ownedSession = [NSURLSession sessionWithConfiguration:sessionConfig + delegate:self + delegateQueue:nil]; + session = self.ownedSession; + } + + self.dataTask = [session dataTaskWithRequest:self.request]; + self.executing = YES; + } + + [self.dataTask resume]; + + if (self.dataTask) { + for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) { + progressBlock(0, NSURLResponseUnknownLength, self.request.URL); + } + __weak typeof(self) weakSelf = self; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStartNotification object:weakSelf]; + }); + } else { + [self callCompletionBlocksWithError:[NSError errorWithDomain:NSURLErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Connection can't be initialized"}]]; + } + +#if SD_UIKIT + Class UIApplicationClass = NSClassFromString(@"UIApplication"); + if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) { + return; + } + if (self.backgroundTaskId != UIBackgroundTaskInvalid) { + UIApplication * app = [UIApplication performSelector:@selector(sharedApplication)]; + [app endBackgroundTask:self.backgroundTaskId]; + self.backgroundTaskId = UIBackgroundTaskInvalid; + } +#endif +} + +- (void)cancel { + @synchronized (self) { + [self cancelInternal]; + } +} + +- (void)cancelInternal { + if (self.isFinished) return; + [super cancel]; + + if (self.dataTask) { + [self.dataTask cancel]; + __weak typeof(self) weakSelf = self; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:weakSelf]; + }); + + // As we cancelled the connection, its callback won't be called and thus won't + // maintain the isFinished and isExecuting flags. + if (self.isExecuting) self.executing = NO; + if (!self.isFinished) self.finished = YES; + } + + [self reset]; +} + +- (void)done { + self.finished = YES; + self.executing = NO; + [self reset]; +} + +- (void)reset { + __weak typeof(self) weakSelf = self; + dispatch_barrier_async(self.barrierQueue, ^{ + [weakSelf.callbackBlocks removeAllObjects]; + }); + self.dataTask = nil; + + NSOperationQueue *delegateQueue; + if (self.unownedSession) { + delegateQueue = self.unownedSession.delegateQueue; + } else { + delegateQueue = self.ownedSession.delegateQueue; + } + if (delegateQueue) { + NSAssert(delegateQueue.maxConcurrentOperationCount == 1, @"NSURLSession delegate queue should be a serial queue"); + [delegateQueue addOperationWithBlock:^{ + weakSelf.imageData = nil; + }]; + } + + if (self.ownedSession) { + [self.ownedSession invalidateAndCancel]; + self.ownedSession = nil; + } +} + +- (void)setFinished:(BOOL)finished { + [self willChangeValueForKey:@"isFinished"]; + _finished = finished; + [self didChangeValueForKey:@"isFinished"]; +} + +- (void)setExecuting:(BOOL)executing { + [self willChangeValueForKey:@"isExecuting"]; + _executing = executing; + [self didChangeValueForKey:@"isExecuting"]; +} + +- (BOOL)isConcurrent { + return YES; +} + +#pragma mark NSURLSessionDataDelegate + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask +didReceiveResponse:(NSURLResponse *)response + completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler { + + //'304 Not Modified' is an exceptional one + if (![response respondsToSelector:@selector(statusCode)] || (((NSHTTPURLResponse *)response).statusCode < 400 && ((NSHTTPURLResponse *)response).statusCode != 304)) { + NSInteger expected = (NSInteger)response.expectedContentLength; + expected = expected > 0 ? expected : 0; + self.expectedSize = expected; + for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) { + progressBlock(0, expected, self.request.URL); + } + + self.imageData = [[NSMutableData alloc] initWithCapacity:expected]; + self.response = response; + __weak typeof(self) weakSelf = self; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadReceiveResponseNotification object:weakSelf]; + }); + } else { + NSUInteger code = ((NSHTTPURLResponse *)response).statusCode; + + //This is the case when server returns '304 Not Modified'. It means that remote image is not changed. + //In case of 304 we need just cancel the operation and return cached image from the cache. + if (code == 304) { + [self cancelInternal]; + } else { + [self.dataTask cancel]; + } + __weak typeof(self) weakSelf = self; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:weakSelf]; + }); + + [self callCompletionBlocksWithError:[NSError errorWithDomain:NSURLErrorDomain code:((NSHTTPURLResponse *)response).statusCode userInfo:nil]]; + + [self done]; + } + + if (completionHandler) { + completionHandler(NSURLSessionResponseAllow); + } +} + +- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data { + [self.imageData appendData:data]; + + if ((self.options & SDWebImageDownloaderProgressiveDownload) && self.expectedSize > 0) { + // Get the image data + NSData *imageData = [self.imageData copy]; + // Get the total bytes downloaded + const NSInteger totalSize = imageData.length; + // Get the finish status + BOOL finished = (totalSize >= self.expectedSize); + + if (!self.progressiveCoder) { + // We need to create a new instance for progressive decoding to avoid conflicts + for (idcoder in [SDWebImageCodersManager sharedInstance].coders) { + if ([coder conformsToProtocol:@protocol(SDWebImageProgressiveCoder)] && + [((id)coder) canIncrementallyDecodeFromData:imageData]) { + self.progressiveCoder = [[[coder class] alloc] init]; + break; + } + } + } + + UIImage *image = [self.progressiveCoder incrementallyDecodedImageWithData:imageData finished:finished]; + if (image) { + NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; + image = [self scaledImageForKey:key image:image]; + if (self.shouldDecompressImages) { + image = [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&data options:@{SDWebImageCoderScaleDownLargeImagesKey: @(NO)}]; + } + + [self callCompletionBlocksWithImage:image imageData:nil error:nil finished:NO]; + } + } + + for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) { + progressBlock(self.imageData.length, self.expectedSize, self.request.URL); + } +} + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask + willCacheResponse:(NSCachedURLResponse *)proposedResponse + completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler { + + NSCachedURLResponse *cachedResponse = proposedResponse; + + if (self.request.cachePolicy == NSURLRequestReloadIgnoringLocalCacheData) { + // Prevents caching of responses + cachedResponse = nil; + } + if (completionHandler) { + completionHandler(cachedResponse); + } +} + +#pragma mark NSURLSessionTaskDelegate + +- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { + @synchronized(self) { + self.dataTask = nil; + __weak typeof(self) weakSelf = self; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:weakSelf]; + if (!error) { + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadFinishNotification object:weakSelf]; + } + }); + } + + if (error) { + [self callCompletionBlocksWithError:error]; + } else { + if ([self callbacksForKey:kCompletedCallbackKey].count > 0) { + /** + * If you specified to use `NSURLCache`, then the response you get here is what you need. + */ + NSData *imageData = [self.imageData copy]; + if (imageData) { + /** if you specified to only use cached data via `SDWebImageDownloaderIgnoreCachedResponse`, + * then we should check if the cached data is equal to image data + */ + if (self.options & SDWebImageDownloaderIgnoreCachedResponse && [self.cachedData isEqualToData:imageData]) { + // call completion block with nil + [self callCompletionBlocksWithImage:nil imageData:nil error:nil finished:YES]; + } else { + UIImage *image = [[SDWebImageCodersManager sharedInstance] decodedImageWithData:imageData]; + NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; + image = [self scaledImageForKey:key image:image]; + + BOOL shouldDecode = YES; + // Do not force decoding animated GIFs and WebPs + if (image.images) { + shouldDecode = NO; + } else { +#ifdef SD_WEBP + SDImageFormat imageFormat = [NSData sd_imageFormatForImageData:imageData]; + if (imageFormat == SDImageFormatWebP) { + shouldDecode = NO; + } +#endif + } + + if (shouldDecode) { + if (self.shouldDecompressImages) { + BOOL shouldScaleDown = self.options & SDWebImageDownloaderScaleDownLargeImages; + image = [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&imageData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(shouldScaleDown)}]; + } + } + if (CGSizeEqualToSize(image.size, CGSizeZero)) { + [self callCompletionBlocksWithError:[NSError errorWithDomain:SDWebImageErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Downloaded image has 0 pixels"}]]; + } else { + [self callCompletionBlocksWithImage:image imageData:imageData error:nil finished:YES]; + } + } + } else { + [self callCompletionBlocksWithError:[NSError errorWithDomain:SDWebImageErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Image data is nil"}]]; + } + } + } + [self done]; +} + +- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler { + + NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling; + __block NSURLCredential *credential = nil; + + if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { + if (!(self.options & SDWebImageDownloaderAllowInvalidSSLCertificates)) { + disposition = NSURLSessionAuthChallengePerformDefaultHandling; + } else { + credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; + disposition = NSURLSessionAuthChallengeUseCredential; + } + } else { + if (challenge.previousFailureCount == 0) { + if (self.credential) { + credential = self.credential; + disposition = NSURLSessionAuthChallengeUseCredential; + } else { + disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge; + } + } else { + disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge; + } + } + + if (completionHandler) { + completionHandler(disposition, credential); + } +} + +#pragma mark Helper methods +- (nullable UIImage *)scaledImageForKey:(nullable NSString *)key image:(nullable UIImage *)image { + return SDScaledImageForKey(key, image); +} + +- (BOOL)shouldContinueWhenAppEntersBackground { + return self.options & SDWebImageDownloaderContinueInBackground; +} + +- (void)callCompletionBlocksWithError:(nullable NSError *)error { + [self callCompletionBlocksWithImage:nil imageData:nil error:error finished:YES]; +} + +- (void)callCompletionBlocksWithImage:(nullable UIImage *)image + imageData:(nullable NSData *)imageData + error:(nullable NSError *)error + finished:(BOOL)finished { + NSArray *completionBlocks = [self callbacksForKey:kCompletedCallbackKey]; + dispatch_main_async_safe(^{ + for (SDWebImageDownloaderCompletedBlock completedBlock in completionBlocks) { + completedBlock(image, imageData, error, finished); + } + }); +} + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageFrame.h b/client/Pods/SDWebImage/SDWebImage/SDWebImageFrame.h new file mode 100644 index 00000000..d8ba1812 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageFrame.h @@ -0,0 +1,34 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" + +@interface SDWebImageFrame : NSObject + +// This class is used for creating animated images via `animatedImageWithFrames` in `SDWebImageCoderHelper`. Attension if you need animated images loop count, use `sd_imageLoopCount` property in `UIImage+MultiFormat` + +/** + The image of current frame. You should not set an animated image. + */ +@property (nonatomic, strong, readonly, nonnull) UIImage *image; +/** + The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero. + */ +@property (nonatomic, readonly, assign) NSTimeInterval duration; + +/** + Create a frame instance with specify image and duration + + @param image current frame's image + @param duration current frame's duration + @return frame instance + */ ++ (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageFrame.m b/client/Pods/SDWebImage/SDWebImage/SDWebImageFrame.m new file mode 100644 index 00000000..b0aefe54 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageFrame.m @@ -0,0 +1,28 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageFrame.h" + +@interface SDWebImageFrame () + +@property (nonatomic, strong, readwrite, nonnull) UIImage *image; +@property (nonatomic, readwrite, assign) NSTimeInterval duration; + +@end + +@implementation SDWebImageFrame + ++ (instancetype)frameWithImage:(UIImage *)image duration:(NSTimeInterval)duration { + SDWebImageFrame *frame = [[SDWebImageFrame alloc] init]; + frame.image = image; + frame.duration = duration; + + return frame; +} + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.h b/client/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.h new file mode 100644 index 00000000..30521f9e --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.h @@ -0,0 +1,23 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCoder.h" + +/** + Built in coder using ImageIO that supports GIF encoding/decoding + @note `SDWebImageIOCoder` supports GIF but only as static (will use the 1st frame). + @note Use `SDWebImageGIFCoder` for fully animated GIFs - less performant than `FLAnimatedImage` + @note If you decide to make all `UIImageView`(including `FLAnimatedImageView`) instance support GIF. You should add this coder to `SDWebImageCodersManager` and make sure that it has a higher priority than `SDWebImageIOCoder` + @note The recommended approach for animated GIFs is using `FLAnimatedImage`. It's more performant than `UIImageView` for GIF displaying + */ +@interface SDWebImageGIFCoder : NSObject + ++ (nonnull instancetype)sharedCoder; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.m b/client/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.m new file mode 100644 index 00000000..005f2b89 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.m @@ -0,0 +1,183 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageGIFCoder.h" +#import "NSImage+WebCache.h" +#import +#import "NSData+ImageContentType.h" +#import "UIImage+MultiFormat.h" +#import "SDWebImageCoderHelper.h" + +@implementation SDWebImageGIFCoder + ++ (instancetype)sharedCoder { + static SDWebImageGIFCoder *coder; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + coder = [[SDWebImageGIFCoder alloc] init]; + }); + return coder; +} + +#pragma mark - Decode +- (BOOL)canDecodeFromData:(nullable NSData *)data { + return ([NSData sd_imageFormatForImageData:data] == SDImageFormatGIF); +} + +- (UIImage *)decodedImageWithData:(NSData *)data { + if (!data) { + return nil; + } + +#if SD_MAC + return [[UIImage alloc] initWithData:data]; +#else + + CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); + if (!source) { + return nil; + } + size_t count = CGImageSourceGetCount(source); + + UIImage *animatedImage; + + if (count <= 1) { + animatedImage = [[UIImage alloc] initWithData:data]; + } else { + NSMutableArray *frames = [NSMutableArray array]; + + for (size_t i = 0; i < count; i++) { + CGImageRef imageRef = CGImageSourceCreateImageAtIndex(source, i, NULL); + if (!imageRef) { + continue; + } + + float duration = [self sd_frameDurationAtIndex:i source:source]; +#if SD_WATCH + CGFloat scale = 1; + scale = [WKInterfaceDevice currentDevice].screenScale; +#elif SD_UIKIT + CGFloat scale = 1; + scale = [UIScreen mainScreen].scale; +#endif + UIImage *image = [UIImage imageWithCGImage:imageRef scale:scale orientation:UIImageOrientationUp]; + CGImageRelease(imageRef); + + SDWebImageFrame *frame = [SDWebImageFrame frameWithImage:image duration:duration]; + [frames addObject:frame]; + } + + NSUInteger loopCount = 0; + NSDictionary *imageProperties = (__bridge_transfer NSDictionary *)CGImageSourceCopyProperties(source, nil); + NSDictionary *gifProperties = [imageProperties valueForKey:(__bridge_transfer NSString *)kCGImagePropertyGIFDictionary]; + if (gifProperties) { + NSNumber *gifLoopCount = [gifProperties valueForKey:(__bridge_transfer NSString *)kCGImagePropertyGIFLoopCount]; + if (gifLoopCount) { + loopCount = gifLoopCount.unsignedIntegerValue; + } + } + + animatedImage = [SDWebImageCoderHelper animatedImageWithFrames:frames]; + animatedImage.sd_imageLoopCount = loopCount; + } + + CFRelease(source); + + return animatedImage; +#endif +} + +- (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source { + float frameDuration = 0.1f; + CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil); + NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties; + NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary]; + + NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; + if (delayTimeUnclampedProp) { + frameDuration = [delayTimeUnclampedProp floatValue]; + } else { + NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime]; + if (delayTimeProp) { + frameDuration = [delayTimeProp floatValue]; + } + } + + // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. + // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify + // a duration of <= 10 ms. See and + // for more information. + + if (frameDuration < 0.011f) { + frameDuration = 0.100f; + } + + CFRelease(cfFrameProperties); + return frameDuration; +} + +- (UIImage *)decompressedImageWithImage:(UIImage *)image + data:(NSData *__autoreleasing _Nullable *)data + options:(nullable NSDictionary*)optionsDict { + // GIF do not decompress + return image; +} + +#pragma mark - Encode +- (BOOL)canEncodeToFormat:(SDImageFormat)format { + return (format == SDImageFormatGIF); +} + +- (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format { + if (!image) { + return nil; + } + + if (format != SDImageFormatGIF) { + return nil; + } + + NSMutableData *imageData = [NSMutableData data]; + CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatGIF]; + NSArray *frames = [SDWebImageCoderHelper framesFromAnimatedImage:image]; + + // Create an image destination. GIF does not support EXIF image orientation + CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, frames.count, NULL); + if (!imageDestination) { + // Handle failure. + return nil; + } + if (frames.count == 0) { + // for static single GIF images + CGImageDestinationAddImage(imageDestination, image.CGImage, nil); + } else { + // for animated GIF images + NSUInteger loopCount = image.sd_imageLoopCount; + NSDictionary *gifProperties = @{(__bridge_transfer NSString *)kCGImagePropertyGIFDictionary: @{(__bridge_transfer NSString *)kCGImagePropertyGIFLoopCount : @(loopCount)}}; + CGImageDestinationSetProperties(imageDestination, (__bridge CFDictionaryRef)gifProperties); + + for (size_t i = 0; i < frames.count; i++) { + SDWebImageFrame *frame = frames[i]; + float frameDuration = frame.duration; + CGImageRef frameImageRef = frame.image.CGImage; + NSDictionary *frameProperties = @{(__bridge_transfer NSString *)kCGImagePropertyGIFDictionary : @{(__bridge_transfer NSString *)kCGImagePropertyGIFUnclampedDelayTime : @(frameDuration)}}; + CGImageDestinationAddImage(imageDestination, frameImageRef, (__bridge CFDictionaryRef)frameProperties); + } + } + // Finalize the destination. + if (CGImageDestinationFinalize(imageDestination) == NO) { + // Handle failure. + imageData = nil; + } + + CFRelease(imageDestination); + + return [imageData copy]; +} + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.h b/client/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.h new file mode 100644 index 00000000..524d9bbe --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.h @@ -0,0 +1,27 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCoder.h" + +/** + Built in coder that supports PNG, JPEG, TIFF, includes support for progressive decoding. + + GIF + Also supports static GIF (meaning will only handle the 1st frame). + For a full GIF support, we recommend `FLAnimatedImage` or our less performant `SDWebImageGIFCoder` + + HEIC + This coder also supports HEIC format because ImageIO supports it natively. But it depends on the system capabilities, so it won't work on all devices. + Hardware works if: (iOS 11 || macOS 10.13) && (isMac || isIPhoneAndA10FusionChipAbove) && (!Simulator) + */ +@interface SDWebImageImageIOCoder : NSObject + ++ (nonnull instancetype)sharedCoder; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.m b/client/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.m new file mode 100644 index 00000000..4e549ebe --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.m @@ -0,0 +1,557 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageImageIOCoder.h" +#import "SDWebImageCoderHelper.h" +#import "NSImage+WebCache.h" +#import +#import "NSData+ImageContentType.h" + +#if SD_UIKIT || SD_WATCH +static const size_t kBytesPerPixel = 4; +static const size_t kBitsPerComponent = 8; + +/* + * Defines the maximum size in MB of the decoded image when the flag `SDWebImageScaleDownLargeImages` is set + * Suggested value for iPad1 and iPhone 3GS: 60. + * Suggested value for iPad2 and iPhone 4: 120. + * Suggested value for iPhone 3G and iPod 2 and earlier devices: 30. + */ +static const CGFloat kDestImageSizeMB = 60.0f; + +/* + * Defines the maximum size in MB of a tile used to decode image when the flag `SDWebImageScaleDownLargeImages` is set + * Suggested value for iPad1 and iPhone 3GS: 20. + * Suggested value for iPad2 and iPhone 4: 40. + * Suggested value for iPhone 3G and iPod 2 and earlier devices: 10. + */ +static const CGFloat kSourceImageTileSizeMB = 20.0f; + +static const CGFloat kBytesPerMB = 1024.0f * 1024.0f; +static const CGFloat kPixelsPerMB = kBytesPerMB / kBytesPerPixel; +static const CGFloat kDestTotalPixels = kDestImageSizeMB * kPixelsPerMB; +static const CGFloat kTileTotalPixels = kSourceImageTileSizeMB * kPixelsPerMB; + +static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to overlap the seems where tiles meet. +#endif + +@implementation SDWebImageImageIOCoder { + size_t _width, _height; +#if SD_UIKIT || SD_WATCH + UIImageOrientation _orientation; +#endif + CGImageSourceRef _imageSource; +} + +- (void)dealloc { + if (_imageSource) { + CFRelease(_imageSource); + _imageSource = NULL; + } +} + ++ (instancetype)sharedCoder { + static SDWebImageImageIOCoder *coder; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + coder = [[SDWebImageImageIOCoder alloc] init]; + }); + return coder; +} + +#pragma mark - Decode +- (BOOL)canDecodeFromData:(nullable NSData *)data { + switch ([NSData sd_imageFormatForImageData:data]) { + case SDImageFormatWebP: + // Do not support WebP decoding + return NO; + default: + return YES; + } +} + +- (BOOL)canIncrementallyDecodeFromData:(NSData *)data { + switch ([NSData sd_imageFormatForImageData:data]) { + case SDImageFormatWebP: + // Do not support WebP progressive decoding + return NO; + default: + return YES; + } +} + +- (UIImage *)decodedImageWithData:(NSData *)data { + if (!data) { + return nil; + } + + UIImage *image = [[UIImage alloc] initWithData:data]; + +#if SD_MAC + return image; +#else + if (!image) { + return nil; + } + + SDImageFormat format = [NSData sd_imageFormatForImageData:data]; + if (format == SDImageFormatGIF) { + // static single GIF need to be created animated for `FLAnimatedImage` logic + // GIF does not support EXIF image orientation + image = [UIImage animatedImageWithImages:@[image] duration:image.duration]; + return image; + } + UIImageOrientation orientation = [[self class] sd_imageOrientationFromImageData:data]; + if (orientation != UIImageOrientationUp) { + image = [UIImage imageWithCGImage:image.CGImage + scale:image.scale + orientation:orientation]; + } + + return image; +#endif +} + +- (UIImage *)incrementallyDecodedImageWithData:(NSData *)data finished:(BOOL)finished { + if (!_imageSource) { + _imageSource = CGImageSourceCreateIncremental(NULL); + } + UIImage *image; + + // The following code is from http://www.cocoaintheshell.com/2011/05/progressive-images-download-imageio/ + // Thanks to the author @Nyx0uf + + // Update the data source, we must pass ALL the data, not just the new bytes + CGImageSourceUpdateData(_imageSource, (__bridge CFDataRef)data, finished); + + if (_width + _height == 0) { + CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(_imageSource, 0, NULL); + if (properties) { + NSInteger orientationValue = 1; + CFTypeRef val = CFDictionaryGetValue(properties, kCGImagePropertyPixelHeight); + if (val) CFNumberGetValue(val, kCFNumberLongType, &_height); + val = CFDictionaryGetValue(properties, kCGImagePropertyPixelWidth); + if (val) CFNumberGetValue(val, kCFNumberLongType, &_width); + val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); + if (val) CFNumberGetValue(val, kCFNumberNSIntegerType, &orientationValue); + CFRelease(properties); + + // When we draw to Core Graphics, we lose orientation information, + // which means the image below born of initWithCGIImage will be + // oriented incorrectly sometimes. (Unlike the image born of initWithData + // in didCompleteWithError.) So save it here and pass it on later. +#if SD_UIKIT || SD_WATCH + _orientation = [SDWebImageCoderHelper imageOrientationFromEXIFOrientation:orientationValue]; +#endif + } + } + + if (_width + _height > 0) { + // Create the image + CGImageRef partialImageRef = CGImageSourceCreateImageAtIndex(_imageSource, 0, NULL); + +#if SD_UIKIT || SD_WATCH + // Workaround for iOS anamorphic image + if (partialImageRef) { + const size_t partialHeight = CGImageGetHeight(partialImageRef); + CGColorSpaceRef colorSpace = SDCGColorSpaceGetDeviceRGB(); + CGContextRef bmContext = CGBitmapContextCreate(NULL, _width, _height, 8, _width * 4, colorSpace, kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); + if (bmContext) { + CGContextDrawImage(bmContext, (CGRect){.origin.x = 0.0f, .origin.y = 0.0f, .size.width = _width, .size.height = partialHeight}, partialImageRef); + CGImageRelease(partialImageRef); + partialImageRef = CGBitmapContextCreateImage(bmContext); + CGContextRelease(bmContext); + } + else { + CGImageRelease(partialImageRef); + partialImageRef = nil; + } + } +#endif + + if (partialImageRef) { +#if SD_UIKIT || SD_WATCH + image = [UIImage imageWithCGImage:partialImageRef scale:1 orientation:_orientation]; +#elif SD_MAC + image = [[UIImage alloc] initWithCGImage:partialImageRef size:NSZeroSize]; +#endif + CGImageRelease(partialImageRef); + } + } + + if (finished) { + if (_imageSource) { + CFRelease(_imageSource); + _imageSource = NULL; + } + } + + return image; +} + +- (UIImage *)decompressedImageWithImage:(UIImage *)image + data:(NSData *__autoreleasing _Nullable *)data + options:(nullable NSDictionary*)optionsDict { +#if SD_MAC + return image; +#endif +#if SD_UIKIT || SD_WATCH + BOOL shouldScaleDown = NO; + if (optionsDict != nil) { + NSNumber *scaleDownLargeImagesOption = nil; + if ([optionsDict[SDWebImageCoderScaleDownLargeImagesKey] isKindOfClass:[NSNumber class]]) { + scaleDownLargeImagesOption = (NSNumber *)optionsDict[SDWebImageCoderScaleDownLargeImagesKey]; + } + if (scaleDownLargeImagesOption != nil) { + shouldScaleDown = [scaleDownLargeImagesOption boolValue]; + } + } + if (!shouldScaleDown) { + return [self sd_decompressedImageWithImage:image]; + } else { + UIImage *scaledDownImage = [self sd_decompressedAndScaledDownImageWithImage:image]; + if (scaledDownImage && !CGSizeEqualToSize(scaledDownImage.size, image.size)) { + // if the image is scaled down, need to modify the data pointer as well + SDImageFormat format = [NSData sd_imageFormatForImageData:*data]; + NSData *imageData = [self encodedDataWithImage:scaledDownImage format:format]; + if (imageData) { + *data = imageData; + } + } + return scaledDownImage; + } +#endif +} + +#if SD_UIKIT || SD_WATCH +- (nullable UIImage *)sd_decompressedImageWithImage:(nullable UIImage *)image { + if (![[self class] shouldDecodeImage:image]) { + return image; + } + + // autorelease the bitmap context and all vars to help system to free memory when there are memory warning. + // on iOS7, do not forget to call [[SDImageCache sharedImageCache] clearMemory]; + @autoreleasepool{ + + CGImageRef imageRef = image.CGImage; + CGColorSpaceRef colorspaceRef = [[self class] colorSpaceForImageRef:imageRef]; + + size_t width = CGImageGetWidth(imageRef); + size_t height = CGImageGetHeight(imageRef); + size_t bytesPerRow = kBytesPerPixel * width; + + // kCGImageAlphaNone is not supported in CGBitmapContextCreate. + // Since the original image here has no alpha info, use kCGImageAlphaNoneSkipLast + // to create bitmap graphics contexts without alpha info. + CGContextRef context = CGBitmapContextCreate(NULL, + width, + height, + kBitsPerComponent, + bytesPerRow, + colorspaceRef, + kCGBitmapByteOrderDefault|kCGImageAlphaNoneSkipLast); + if (context == NULL) { + return image; + } + + // Draw the image into the context and retrieve the new bitmap image without alpha + CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); + CGImageRef imageRefWithoutAlpha = CGBitmapContextCreateImage(context); + UIImage *imageWithoutAlpha = [UIImage imageWithCGImage:imageRefWithoutAlpha + scale:image.scale + orientation:image.imageOrientation]; + + CGContextRelease(context); + CGImageRelease(imageRefWithoutAlpha); + + return imageWithoutAlpha; + } +} + +- (nullable UIImage *)sd_decompressedAndScaledDownImageWithImage:(nullable UIImage *)image { + if (![[self class] shouldDecodeImage:image]) { + return image; + } + + if (![[self class] shouldScaleDownImage:image]) { + return [self sd_decompressedImageWithImage:image]; + } + + CGContextRef destContext; + + // autorelease the bitmap context and all vars to help system to free memory when there are memory warning. + // on iOS7, do not forget to call [[SDImageCache sharedImageCache] clearMemory]; + @autoreleasepool { + CGImageRef sourceImageRef = image.CGImage; + + CGSize sourceResolution = CGSizeZero; + sourceResolution.width = CGImageGetWidth(sourceImageRef); + sourceResolution.height = CGImageGetHeight(sourceImageRef); + float sourceTotalPixels = sourceResolution.width * sourceResolution.height; + // Determine the scale ratio to apply to the input image + // that results in an output image of the defined size. + // see kDestImageSizeMB, and how it relates to destTotalPixels. + float imageScale = kDestTotalPixels / sourceTotalPixels; + CGSize destResolution = CGSizeZero; + destResolution.width = (int)(sourceResolution.width*imageScale); + destResolution.height = (int)(sourceResolution.height*imageScale); + + // current color space + CGColorSpaceRef colorspaceRef = [[self class] colorSpaceForImageRef:sourceImageRef]; + + size_t bytesPerRow = kBytesPerPixel * destResolution.width; + + // kCGImageAlphaNone is not supported in CGBitmapContextCreate. + // Since the original image here has no alpha info, use kCGImageAlphaNoneSkipLast + // to create bitmap graphics contexts without alpha info. + destContext = CGBitmapContextCreate(NULL, + destResolution.width, + destResolution.height, + kBitsPerComponent, + bytesPerRow, + colorspaceRef, + kCGBitmapByteOrderDefault|kCGImageAlphaNoneSkipLast); + + if (destContext == NULL) { + return image; + } + CGContextSetInterpolationQuality(destContext, kCGInterpolationHigh); + + // Now define the size of the rectangle to be used for the + // incremental blits from the input image to the output image. + // we use a source tile width equal to the width of the source + // image due to the way that iOS retrieves image data from disk. + // iOS must decode an image from disk in full width 'bands', even + // if current graphics context is clipped to a subrect within that + // band. Therefore we fully utilize all of the pixel data that results + // from a decoding opertion by achnoring our tile size to the full + // width of the input image. + CGRect sourceTile = CGRectZero; + sourceTile.size.width = sourceResolution.width; + // The source tile height is dynamic. Since we specified the size + // of the source tile in MB, see how many rows of pixels high it + // can be given the input image width. + sourceTile.size.height = (int)(kTileTotalPixels / sourceTile.size.width ); + sourceTile.origin.x = 0.0f; + // The output tile is the same proportions as the input tile, but + // scaled to image scale. + CGRect destTile; + destTile.size.width = destResolution.width; + destTile.size.height = sourceTile.size.height * imageScale; + destTile.origin.x = 0.0f; + // The source seem overlap is proportionate to the destination seem overlap. + // this is the amount of pixels to overlap each tile as we assemble the ouput image. + float sourceSeemOverlap = (int)((kDestSeemOverlap/destResolution.height)*sourceResolution.height); + CGImageRef sourceTileImageRef; + // calculate the number of read/write operations required to assemble the + // output image. + int iterations = (int)( sourceResolution.height / sourceTile.size.height ); + // If tile height doesn't divide the image height evenly, add another iteration + // to account for the remaining pixels. + int remainder = (int)sourceResolution.height % (int)sourceTile.size.height; + if(remainder) { + iterations++; + } + // Add seem overlaps to the tiles, but save the original tile height for y coordinate calculations. + float sourceTileHeightMinusOverlap = sourceTile.size.height; + sourceTile.size.height += sourceSeemOverlap; + destTile.size.height += kDestSeemOverlap; + for( int y = 0; y < iterations; ++y ) { + @autoreleasepool { + sourceTile.origin.y = y * sourceTileHeightMinusOverlap + sourceSeemOverlap; + destTile.origin.y = destResolution.height - (( y + 1 ) * sourceTileHeightMinusOverlap * imageScale + kDestSeemOverlap); + sourceTileImageRef = CGImageCreateWithImageInRect( sourceImageRef, sourceTile ); + if( y == iterations - 1 && remainder ) { + float dify = destTile.size.height; + destTile.size.height = CGImageGetHeight( sourceTileImageRef ) * imageScale; + dify -= destTile.size.height; + destTile.origin.y += dify; + } + CGContextDrawImage( destContext, destTile, sourceTileImageRef ); + CGImageRelease( sourceTileImageRef ); + } + } + + CGImageRef destImageRef = CGBitmapContextCreateImage(destContext); + CGContextRelease(destContext); + if (destImageRef == NULL) { + return image; + } + UIImage *destImage = [UIImage imageWithCGImage:destImageRef scale:image.scale orientation:image.imageOrientation]; + CGImageRelease(destImageRef); + if (destImage == nil) { + return image; + } + return destImage; + } +} +#endif + +#pragma mark - Encode +- (BOOL)canEncodeToFormat:(SDImageFormat)format { + switch (format) { + case SDImageFormatWebP: + // Do not support WebP encoding + return NO; + case SDImageFormatHEIC: + // Check HEIC encoding compatibility + return [[self class] canEncodeToHEICFormat]; + default: + return YES; + } +} + +- (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format { + if (!image) { + return nil; + } + + if (format == SDImageFormatUndefined) { + BOOL hasAlpha = SDCGImageRefContainsAlpha(image.CGImage); + if (hasAlpha) { + format = SDImageFormatPNG; + } else { + format = SDImageFormatJPEG; + } + } + + NSMutableData *imageData = [NSMutableData data]; + CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:format]; + + // Create an image destination. + CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, 1, NULL); + if (!imageDestination) { + // Handle failure. + return nil; + } + + NSMutableDictionary *properties = [NSMutableDictionary dictionary]; +#if SD_UIKIT || SD_WATCH + NSInteger exifOrientation = [SDWebImageCoderHelper exifOrientationFromImageOrientation:image.imageOrientation]; + [properties setValue:@(exifOrientation) forKey:(__bridge_transfer NSString *)kCGImagePropertyOrientation]; +#endif + + // Add your image to the destination. + CGImageDestinationAddImage(imageDestination, image.CGImage, (__bridge CFDictionaryRef)properties); + + // Finalize the destination. + if (CGImageDestinationFinalize(imageDestination) == NO) { + // Handle failure. + imageData = nil; + } + + CFRelease(imageDestination); + + return [imageData copy]; +} + +#pragma mark - Helper ++ (BOOL)shouldDecodeImage:(nullable UIImage *)image { + // Prevent "CGBitmapContextCreateImage: invalid context 0x0" error + if (image == nil) { + return NO; + } + + // do not decode animated images + if (image.images != nil) { + return NO; + } + + CGImageRef imageRef = image.CGImage; + + BOOL hasAlpha = SDCGImageRefContainsAlpha(imageRef); + // do not decode images with alpha + if (hasAlpha) { + return NO; + } + + return YES; +} + ++ (BOOL)canEncodeToHEICFormat { + static BOOL canEncode = NO; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSMutableData *imageData = [NSMutableData data]; + CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatHEIC]; + + // Create an image destination. + CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, 1, NULL); + if (!imageDestination) { + // Can't encode to HEIC + canEncode = NO; + } else { + // Can encode to HEIC + CFRelease(imageDestination); + canEncode = YES; + } + }); + return canEncode; +} + +#if SD_UIKIT || SD_WATCH +#pragma mark EXIF orientation tag converter ++ (UIImageOrientation)sd_imageOrientationFromImageData:(nonnull NSData *)imageData { + UIImageOrientation result = UIImageOrientationUp; + CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); + if (imageSource) { + CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); + if (properties) { + CFTypeRef val; + NSInteger exifOrientation; + val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); + if (val) { + CFNumberGetValue(val, kCFNumberNSIntegerType, &exifOrientation); + result = [SDWebImageCoderHelper imageOrientationFromEXIFOrientation:exifOrientation]; + } // else - if it's not set it remains at up + CFRelease((CFTypeRef) properties); + } else { + //NSLog(@"NO PROPERTIES, FAIL"); + } + CFRelease(imageSource); + } + return result; +} +#endif + +#if SD_UIKIT || SD_WATCH ++ (BOOL)shouldScaleDownImage:(nonnull UIImage *)image { + BOOL shouldScaleDown = YES; + + CGImageRef sourceImageRef = image.CGImage; + CGSize sourceResolution = CGSizeZero; + sourceResolution.width = CGImageGetWidth(sourceImageRef); + sourceResolution.height = CGImageGetHeight(sourceImageRef); + float sourceTotalPixels = sourceResolution.width * sourceResolution.height; + float imageScale = kDestTotalPixels / sourceTotalPixels; + if (imageScale < 1) { + shouldScaleDown = YES; + } else { + shouldScaleDown = NO; + } + + return shouldScaleDown; +} + ++ (CGColorSpaceRef)colorSpaceForImageRef:(CGImageRef)imageRef { + // current + CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(CGImageGetColorSpace(imageRef)); + CGColorSpaceRef colorspaceRef = CGImageGetColorSpace(imageRef); + + BOOL unsupportedColorSpace = (imageColorSpaceModel == kCGColorSpaceModelUnknown || + imageColorSpaceModel == kCGColorSpaceModelMonochrome || + imageColorSpaceModel == kCGColorSpaceModelCMYK || + imageColorSpaceModel == kCGColorSpaceModelIndexed); + if (unsupportedColorSpace) { + colorspaceRef = SDCGColorSpaceGetDeviceRGB(); + } + return colorspaceRef; +} +#endif + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageManager.h b/client/Pods/SDWebImage/SDWebImage/SDWebImageManager.h new file mode 100644 index 00000000..ba8b7555 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageManager.h @@ -0,0 +1,275 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" +#import "SDWebImageOperation.h" +#import "SDWebImageDownloader.h" +#import "SDImageCache.h" + +typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) { + /** + * By default, when a URL fail to be downloaded, the URL is blacklisted so the library won't keep trying. + * This flag disable this blacklisting. + */ + SDWebImageRetryFailed = 1 << 0, + + /** + * By default, image downloads are started during UI interactions, this flags disable this feature, + * leading to delayed download on UIScrollView deceleration for instance. + */ + SDWebImageLowPriority = 1 << 1, + + /** + * This flag disables on-disk caching + */ + SDWebImageCacheMemoryOnly = 1 << 2, + + /** + * This flag enables progressive download, the image is displayed progressively during download as a browser would do. + * By default, the image is only displayed once completely downloaded. + */ + SDWebImageProgressiveDownload = 1 << 3, + + /** + * Even if the image is cached, respect the HTTP response cache control, and refresh the image from remote location if needed. + * The disk caching will be handled by NSURLCache instead of SDWebImage leading to slight performance degradation. + * This option helps deal with images changing behind the same request URL, e.g. Facebook graph api profile pics. + * If a cached image is refreshed, the completion block is called once with the cached image and again with the final image. + * + * Use this flag only if you can't make your URLs static with embedded cache busting parameter. + */ + SDWebImageRefreshCached = 1 << 4, + + /** + * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for + * extra time in background to let the request finish. If the background task expires the operation will be cancelled. + */ + SDWebImageContinueInBackground = 1 << 5, + + /** + * Handles cookies stored in NSHTTPCookieStore by setting + * NSMutableURLRequest.HTTPShouldHandleCookies = YES; + */ + SDWebImageHandleCookies = 1 << 6, + + /** + * Enable to allow untrusted SSL certificates. + * Useful for testing purposes. Use with caution in production. + */ + SDWebImageAllowInvalidSSLCertificates = 1 << 7, + + /** + * By default, images are loaded in the order in which they were queued. This flag moves them to + * the front of the queue. + */ + SDWebImageHighPriority = 1 << 8, + + /** + * By default, placeholder images are loaded while the image is loading. This flag will delay the loading + * of the placeholder image until after the image has finished loading. + */ + SDWebImageDelayPlaceholder = 1 << 9, + + /** + * We usually don't call transformDownloadedImage delegate method on animated images, + * as most transformation code would mangle it. + * Use this flag to transform them anyway. + */ + SDWebImageTransformAnimatedImage = 1 << 10, + + /** + * By default, image is added to the imageView after download. But in some cases, we want to + * have the hand before setting the image (apply a filter or add it with cross-fade animation for instance) + * Use this flag if you want to manually set the image in the completion when success + */ + SDWebImageAvoidAutoSetImage = 1 << 11, + + /** + * By default, images are decoded respecting their original size. On iOS, this flag will scale down the + * images to a size compatible with the constrained memory of devices. + * If `SDWebImageProgressiveDownload` flag is set the scale down is deactivated. + */ + SDWebImageScaleDownLargeImages = 1 << 12 +}; + +typedef void(^SDExternalCompletionBlock)(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL); + +typedef void(^SDInternalCompletionBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL); + +typedef NSString * _Nullable (^SDWebImageCacheKeyFilterBlock)(NSURL * _Nullable url); + + +@class SDWebImageManager; + +@protocol SDWebImageManagerDelegate + +@optional + +/** + * Controls which image should be downloaded when the image is not found in the cache. + * + * @param imageManager The current `SDWebImageManager` + * @param imageURL The url of the image to be downloaded + * + * @return Return NO to prevent the downloading of the image on cache misses. If not implemented, YES is implied. + */ +- (BOOL)imageManager:(nonnull SDWebImageManager *)imageManager shouldDownloadImageForURL:(nullable NSURL *)imageURL; + +/** + * Allows to transform the image immediately after it has been downloaded and just before to cache it on disk and memory. + * NOTE: This method is called from a global queue in order to not to block the main thread. + * + * @param imageManager The current `SDWebImageManager` + * @param image The image to transform + * @param imageURL The url of the image to transform + * + * @return The transformed image object. + */ +- (nullable UIImage *)imageManager:(nonnull SDWebImageManager *)imageManager transformDownloadedImage:(nullable UIImage *)image withURL:(nullable NSURL *)imageURL; + +@end + +/** + * The SDWebImageManager is the class behind the UIImageView+WebCache category and likes. + * It ties the asynchronous downloader (SDWebImageDownloader) with the image cache store (SDImageCache). + * You can use this class directly to benefit from web image downloading with caching in another context than + * a UIView. + * + * Here is a simple example of how to use SDWebImageManager: + * + * @code + +SDWebImageManager *manager = [SDWebImageManager sharedManager]; +[manager loadImageWithURL:imageURL + options:0 + progress:nil + completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (image) { + // do something with image + } + }]; + + * @endcode + */ +@interface SDWebImageManager : NSObject + +@property (weak, nonatomic, nullable) id delegate; + +@property (strong, nonatomic, readonly, nullable) SDImageCache *imageCache; +@property (strong, nonatomic, readonly, nullable) SDWebImageDownloader *imageDownloader; + +/** + * The cache filter is a block used each time SDWebImageManager need to convert an URL into a cache key. This can + * be used to remove dynamic part of an image URL. + * + * The following example sets a filter in the application delegate that will remove any query-string from the + * URL before to use it as a cache key: + * + * @code + +[[SDWebImageManager sharedManager] setCacheKeyFilter:^(NSURL *url) { + url = [[NSURL alloc] initWithScheme:url.scheme host:url.host path:url.path]; + return [url absoluteString]; +}]; + + * @endcode + */ +@property (nonatomic, copy, nullable) SDWebImageCacheKeyFilterBlock cacheKeyFilter; + +/** + * Returns global SDWebImageManager instance. + * + * @return SDWebImageManager shared instance + */ ++ (nonnull instancetype)sharedManager; + +/** + * Allows to specify instance of cache and image downloader used with image manager. + * @return new instance of `SDWebImageManager` with specified cache and downloader. + */ +- (nonnull instancetype)initWithCache:(nonnull SDImageCache *)cache downloader:(nonnull SDWebImageDownloader *)downloader NS_DESIGNATED_INITIALIZER; + +/** + * Downloads the image at the given URL if not present in cache or return the cached version otherwise. + * + * @param url The URL to the image + * @param options A mask to specify options to use for this request + * @param progressBlock A block called while image is downloading + * @note the progress block is executed on a background queue + * @param completedBlock A block called when operation has been completed. + * + * This parameter is required. + * + * This block has no return value and takes the requested UIImage as first parameter and the NSData representation as second parameter. + * In case of error the image parameter is nil and the third parameter may contain an NSError. + * + * The forth parameter is an `SDImageCacheType` enum indicating if the image was retrieved from the local cache + * or from the memory cache or from the network. + * + * The fith parameter is set to NO when the SDWebImageProgressiveDownload option is used and the image is + * downloading. This block is thus called repeatedly with a partial image. When image is fully downloaded, the + * block is called a last time with the full image and the last parameter set to YES. + * + * The last parameter is the original image URL + * + * @return Returns an NSObject conforming to SDWebImageOperation. Should be an instance of SDWebImageDownloaderOperation + */ +- (nullable id )loadImageWithURL:(nullable NSURL *)url + options:(SDWebImageOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDInternalCompletionBlock)completedBlock; + +/** + * Saves image to cache for given URL + * + * @param image The image to cache + * @param url The URL to the image + * + */ + +- (void)saveImageToCache:(nullable UIImage *)image forURL:(nullable NSURL *)url; + +/** + * Cancel all current operations + */ +- (void)cancelAll; + +/** + * Check one or more operations running + */ +- (BOOL)isRunning; + +/** + * Async check if image has already been cached + * + * @param url image url + * @param completionBlock the block to be executed when the check is finished + * + * @note the completion block is always executed on the main queue + */ +- (void)cachedImageExistsForURL:(nullable NSURL *)url + completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock; + +/** + * Async check if image has already been cached on disk only + * + * @param url image url + * @param completionBlock the block to be executed when the check is finished + * + * @note the completion block is always executed on the main queue + */ +- (void)diskImageExistsForURL:(nullable NSURL *)url + completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock; + + +/** + *Return the cache key for a given URL + */ +- (nullable NSString *)cacheKeyForURL:(nullable NSURL *)url; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageManager.m b/client/Pods/SDWebImage/SDWebImage/SDWebImageManager.m new file mode 100644 index 00000000..df9b8411 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageManager.m @@ -0,0 +1,338 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageManager.h" +#import "NSImage+WebCache.h" +#import + +@interface SDWebImageCombinedOperation : NSObject + +@property (assign, nonatomic, getter = isCancelled) BOOL cancelled; +@property (copy, nonatomic, nullable) SDWebImageNoParamsBlock cancelBlock; +@property (strong, nonatomic, nullable) NSOperation *cacheOperation; + +@end + +@interface SDWebImageManager () + +@property (strong, nonatomic, readwrite, nonnull) SDImageCache *imageCache; +@property (strong, nonatomic, readwrite, nonnull) SDWebImageDownloader *imageDownloader; +@property (strong, nonatomic, nonnull) NSMutableSet *failedURLs; +@property (strong, nonatomic, nonnull) NSMutableArray *runningOperations; + +@end + +@implementation SDWebImageManager + ++ (nonnull instancetype)sharedManager { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (nonnull instancetype)init { + SDImageCache *cache = [SDImageCache sharedImageCache]; + SDWebImageDownloader *downloader = [SDWebImageDownloader sharedDownloader]; + return [self initWithCache:cache downloader:downloader]; +} + +- (nonnull instancetype)initWithCache:(nonnull SDImageCache *)cache downloader:(nonnull SDWebImageDownloader *)downloader { + if ((self = [super init])) { + _imageCache = cache; + _imageDownloader = downloader; + _failedURLs = [NSMutableSet new]; + _runningOperations = [NSMutableArray new]; + } + return self; +} + +- (nullable NSString *)cacheKeyForURL:(nullable NSURL *)url { + if (!url) { + return @""; + } + + if (self.cacheKeyFilter) { + return self.cacheKeyFilter(url); + } else { + return url.absoluteString; + } +} + +- (void)cachedImageExistsForURL:(nullable NSURL *)url + completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock { + NSString *key = [self cacheKeyForURL:url]; + + BOOL isInMemoryCache = ([self.imageCache imageFromMemoryCacheForKey:key] != nil); + + if (isInMemoryCache) { + // making sure we call the completion block on the main queue + dispatch_async(dispatch_get_main_queue(), ^{ + if (completionBlock) { + completionBlock(YES); + } + }); + return; + } + + [self.imageCache diskImageExistsWithKey:key completion:^(BOOL isInDiskCache) { + // the completion block of checkDiskCacheForImageWithKey:completion: is always called on the main queue, no need to further dispatch + if (completionBlock) { + completionBlock(isInDiskCache); + } + }]; +} + +- (void)diskImageExistsForURL:(nullable NSURL *)url + completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock { + NSString *key = [self cacheKeyForURL:url]; + + [self.imageCache diskImageExistsWithKey:key completion:^(BOOL isInDiskCache) { + // the completion block of checkDiskCacheForImageWithKey:completion: is always called on the main queue, no need to further dispatch + if (completionBlock) { + completionBlock(isInDiskCache); + } + }]; +} + +- (id )loadImageWithURL:(nullable NSURL *)url + options:(SDWebImageOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDInternalCompletionBlock)completedBlock { + // Invoking this method without a completedBlock is pointless + NSAssert(completedBlock != nil, @"If you mean to prefetch the image, use -[SDWebImagePrefetcher prefetchURLs] instead"); + + // Very common mistake is to send the URL using NSString object instead of NSURL. For some strange reason, Xcode won't + // throw any warning for this type mismatch. Here we failsafe this error by allowing URLs to be passed as NSString. + if ([url isKindOfClass:NSString.class]) { + url = [NSURL URLWithString:(NSString *)url]; + } + + // Prevents app crashing on argument type error like sending NSNull instead of NSURL + if (![url isKindOfClass:NSURL.class]) { + url = nil; + } + + __block SDWebImageCombinedOperation *operation = [SDWebImageCombinedOperation new]; + __weak SDWebImageCombinedOperation *weakOperation = operation; + + BOOL isFailedUrl = NO; + if (url) { + @synchronized (self.failedURLs) { + isFailedUrl = [self.failedURLs containsObject:url]; + } + } + + if (url.absoluteString.length == 0 || (!(options & SDWebImageRetryFailed) && isFailedUrl)) { + [self callCompletionBlockForOperation:operation completion:completedBlock error:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist userInfo:nil] url:url]; + return operation; + } + + @synchronized (self.runningOperations) { + [self.runningOperations addObject:operation]; + } + NSString *key = [self cacheKeyForURL:url]; + + operation.cacheOperation = [self.imageCache queryCacheOperationForKey:key done:^(UIImage *cachedImage, NSData *cachedData, SDImageCacheType cacheType) { + if (operation.isCancelled) { + [self safelyRemoveOperationFromRunning:operation]; + return; + } + + if ((!cachedImage || options & SDWebImageRefreshCached) && (![self.delegate respondsToSelector:@selector(imageManager:shouldDownloadImageForURL:)] || [self.delegate imageManager:self shouldDownloadImageForURL:url])) { + if (cachedImage && options & SDWebImageRefreshCached) { + // If image was found in the cache but SDWebImageRefreshCached is provided, notify about the cached image + // AND try to re-download it in order to let a chance to NSURLCache to refresh it from server. + [self callCompletionBlockForOperation:weakOperation completion:completedBlock image:cachedImage data:cachedData error:nil cacheType:cacheType finished:YES url:url]; + } + + // download if no image or requested to refresh anyway, and download allowed by delegate + SDWebImageDownloaderOptions downloaderOptions = 0; + if (options & SDWebImageLowPriority) downloaderOptions |= SDWebImageDownloaderLowPriority; + if (options & SDWebImageProgressiveDownload) downloaderOptions |= SDWebImageDownloaderProgressiveDownload; + if (options & SDWebImageRefreshCached) downloaderOptions |= SDWebImageDownloaderUseNSURLCache; + if (options & SDWebImageContinueInBackground) downloaderOptions |= SDWebImageDownloaderContinueInBackground; + if (options & SDWebImageHandleCookies) downloaderOptions |= SDWebImageDownloaderHandleCookies; + if (options & SDWebImageAllowInvalidSSLCertificates) downloaderOptions |= SDWebImageDownloaderAllowInvalidSSLCertificates; + if (options & SDWebImageHighPriority) downloaderOptions |= SDWebImageDownloaderHighPriority; + if (options & SDWebImageScaleDownLargeImages) downloaderOptions |= SDWebImageDownloaderScaleDownLargeImages; + + if (cachedImage && options & SDWebImageRefreshCached) { + // force progressive off if image already cached but forced refreshing + downloaderOptions &= ~SDWebImageDownloaderProgressiveDownload; + // ignore image read from NSURLCache if image if cached but force refreshing + downloaderOptions |= SDWebImageDownloaderIgnoreCachedResponse; + } + + SDWebImageDownloadToken *subOperationToken = [self.imageDownloader downloadImageWithURL:url options:downloaderOptions progress:progressBlock completed:^(UIImage *downloadedImage, NSData *downloadedData, NSError *error, BOOL finished) { + __strong __typeof(weakOperation) strongOperation = weakOperation; + if (!strongOperation || strongOperation.isCancelled) { + // Do nothing if the operation was cancelled + // See #699 for more details + // if we would call the completedBlock, there could be a race condition between this block and another completedBlock for the same object, so if this one is called second, we will overwrite the new data + } else if (error) { + [self callCompletionBlockForOperation:strongOperation completion:completedBlock error:error url:url]; + + if ( error.code != NSURLErrorNotConnectedToInternet + && error.code != NSURLErrorCancelled + && error.code != NSURLErrorTimedOut + && error.code != NSURLErrorInternationalRoamingOff + && error.code != NSURLErrorDataNotAllowed + && error.code != NSURLErrorCannotFindHost + && error.code != NSURLErrorCannotConnectToHost + && error.code != NSURLErrorNetworkConnectionLost) { + @synchronized (self.failedURLs) { + [self.failedURLs addObject:url]; + } + } + } + else { + if ((options & SDWebImageRetryFailed)) { + @synchronized (self.failedURLs) { + [self.failedURLs removeObject:url]; + } + } + + BOOL cacheOnDisk = !(options & SDWebImageCacheMemoryOnly); + + if (options & SDWebImageRefreshCached && cachedImage && !downloadedImage) { + // Image refresh hit the NSURLCache cache, do not call the completion block + } else if (downloadedImage && (!downloadedImage.images || (options & SDWebImageTransformAnimatedImage)) && [self.delegate respondsToSelector:@selector(imageManager:transformDownloadedImage:withURL:)]) { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ + UIImage *transformedImage = [self.delegate imageManager:self transformDownloadedImage:downloadedImage withURL:url]; + + if (transformedImage && finished) { + BOOL imageWasTransformed = ![transformedImage isEqual:downloadedImage]; + // pass nil if the image was transformed, so we can recalculate the data from the image + [self.imageCache storeImage:transformedImage imageData:(imageWasTransformed ? nil : downloadedData) forKey:key toDisk:cacheOnDisk completion:nil]; + } + + [self callCompletionBlockForOperation:strongOperation completion:completedBlock image:transformedImage data:downloadedData error:nil cacheType:SDImageCacheTypeNone finished:finished url:url]; + }); + } else { + if (downloadedImage && finished) { + [self.imageCache storeImage:downloadedImage imageData:downloadedData forKey:key toDisk:cacheOnDisk completion:nil]; + } + [self callCompletionBlockForOperation:strongOperation completion:completedBlock image:downloadedImage data:downloadedData error:nil cacheType:SDImageCacheTypeNone finished:finished url:url]; + } + } + + if (finished) { + [self safelyRemoveOperationFromRunning:strongOperation]; + } + }]; + @synchronized(operation) { + // Need same lock to ensure cancelBlock called because cancel method can be called in different queue + operation.cancelBlock = ^{ + [self.imageDownloader cancel:subOperationToken]; + __strong __typeof(weakOperation) strongOperation = weakOperation; + [self safelyRemoveOperationFromRunning:strongOperation]; + }; + } + } else if (cachedImage) { + __strong __typeof(weakOperation) strongOperation = weakOperation; + [self callCompletionBlockForOperation:strongOperation completion:completedBlock image:cachedImage data:cachedData error:nil cacheType:cacheType finished:YES url:url]; + [self safelyRemoveOperationFromRunning:operation]; + } else { + // Image not in cache and download disallowed by delegate + __strong __typeof(weakOperation) strongOperation = weakOperation; + [self callCompletionBlockForOperation:strongOperation completion:completedBlock image:nil data:nil error:nil cacheType:SDImageCacheTypeNone finished:YES url:url]; + [self safelyRemoveOperationFromRunning:operation]; + } + }]; + + return operation; +} + +- (void)saveImageToCache:(nullable UIImage *)image forURL:(nullable NSURL *)url { + if (image && url) { + NSString *key = [self cacheKeyForURL:url]; + [self.imageCache storeImage:image forKey:key toDisk:YES completion:nil]; + } +} + +- (void)cancelAll { + @synchronized (self.runningOperations) { + NSArray *copiedOperations = [self.runningOperations copy]; + [copiedOperations makeObjectsPerformSelector:@selector(cancel)]; + [self.runningOperations removeObjectsInArray:copiedOperations]; + } +} + +- (BOOL)isRunning { + BOOL isRunning = NO; + @synchronized (self.runningOperations) { + isRunning = (self.runningOperations.count > 0); + } + return isRunning; +} + +- (void)safelyRemoveOperationFromRunning:(nullable SDWebImageCombinedOperation*)operation { + @synchronized (self.runningOperations) { + if (operation) { + [self.runningOperations removeObject:operation]; + } + } +} + +- (void)callCompletionBlockForOperation:(nullable SDWebImageCombinedOperation*)operation + completion:(nullable SDInternalCompletionBlock)completionBlock + error:(nullable NSError *)error + url:(nullable NSURL *)url { + [self callCompletionBlockForOperation:operation completion:completionBlock image:nil data:nil error:error cacheType:SDImageCacheTypeNone finished:YES url:url]; +} + +- (void)callCompletionBlockForOperation:(nullable SDWebImageCombinedOperation*)operation + completion:(nullable SDInternalCompletionBlock)completionBlock + image:(nullable UIImage *)image + data:(nullable NSData *)data + error:(nullable NSError *)error + cacheType:(SDImageCacheType)cacheType + finished:(BOOL)finished + url:(nullable NSURL *)url { + dispatch_main_async_safe(^{ + if (operation && !operation.isCancelled && completionBlock) { + completionBlock(image, data, error, cacheType, finished, url); + } + }); +} + +@end + + +@implementation SDWebImageCombinedOperation + +- (void)setCancelBlock:(nullable SDWebImageNoParamsBlock)cancelBlock { + // check if the operation is already cancelled, then we just call the cancelBlock + if (self.isCancelled) { + if (cancelBlock) { + cancelBlock(); + } + _cancelBlock = nil; // don't forget to nil the cancelBlock, otherwise we will get crashes + } else { + _cancelBlock = [cancelBlock copy]; + } +} + +- (void)cancel { + @synchronized(self) { + self.cancelled = YES; + if (self.cacheOperation) { + [self.cacheOperation cancel]; + self.cacheOperation = nil; + } + if (self.cancelBlock) { + self.cancelBlock(); + self.cancelBlock = nil; + } + } +} + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h b/client/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h new file mode 100644 index 00000000..71094ee3 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h @@ -0,0 +1,15 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import + +@protocol SDWebImageOperation + +- (void)cancel; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h b/client/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h new file mode 100644 index 00000000..c299de17 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h @@ -0,0 +1,112 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageManager.h" + +@class SDWebImagePrefetcher; + +@protocol SDWebImagePrefetcherDelegate + +@optional + +/** + * Called when an image was prefetched. + * + * @param imagePrefetcher The current image prefetcher + * @param imageURL The image url that was prefetched + * @param finishedCount The total number of images that were prefetched (successful or not) + * @param totalCount The total number of images that were to be prefetched + */ +- (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(nullable NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; + +/** + * Called when all images are prefetched. + * @param imagePrefetcher The current image prefetcher + * @param totalCount The total number of images that were prefetched (whether successful or not) + * @param skippedCount The total number of images that were skipped + */ +- (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; + +@end + +typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); +typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); + +/** + * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. + */ +@interface SDWebImagePrefetcher : NSObject + +/** + * The web image manager + */ +@property (strong, nonatomic, readonly, nonnull) SDWebImageManager *manager; + +/** + * Maximum number of URLs to prefetch at the same time. Defaults to 3. + */ +@property (nonatomic, assign) NSUInteger maxConcurrentDownloads; + +/** + * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. + */ +@property (nonatomic, assign) SDWebImageOptions options; + +/** + * Queue options for Prefetcher. Defaults to Main Queue. + */ +@property (SDDispatchQueueSetterSementics, nonatomic, nonnull) dispatch_queue_t prefetcherQueue; + +@property (weak, nonatomic, nullable) id delegate; + +/** + * Return the global image prefetcher instance. + */ ++ (nonnull instancetype)sharedImagePrefetcher; + +/** + * Allows you to instantiate a prefetcher with any arbitrary image manager. + */ +- (nonnull instancetype)initWithImageManager:(nonnull SDWebImageManager *)manager NS_DESIGNATED_INITIALIZER; + +/** + * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, + * currently one image is downloaded at a time, + * and skips images for failed downloads and proceed to the next image in the list. + * Any previously-running prefetch operations are canceled. + * + * @param urls list of URLs to prefetch + */ +- (void)prefetchURLs:(nullable NSArray *)urls; + +/** + * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, + * currently one image is downloaded at a time, + * and skips images for failed downloads and proceed to the next image in the list. + * Any previously-running prefetch operations are canceled. + * + * @param urls list of URLs to prefetch + * @param progressBlock block to be called when progress updates; + * first parameter is the number of completed (successful or not) requests, + * second parameter is the total number of images originally requested to be prefetched + * @param completionBlock block to be called when prefetching is completed + * first param is the number of completed (successful or not) requests, + * second parameter is the number of skipped requests + */ +- (void)prefetchURLs:(nullable NSArray *)urls + progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock + completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock; + +/** + * Remove and cancel queued list + */ +- (void)cancelPrefetching; + + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m b/client/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m new file mode 100644 index 00000000..b66357f1 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m @@ -0,0 +1,142 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImagePrefetcher.h" + +@interface SDWebImagePrefetcher () + +@property (strong, nonatomic, nonnull) SDWebImageManager *manager; +@property (strong, nonatomic, nullable) NSArray *prefetchURLs; +@property (assign, nonatomic) NSUInteger requestedCount; +@property (assign, nonatomic) NSUInteger skippedCount; +@property (assign, nonatomic) NSUInteger finishedCount; +@property (assign, nonatomic) NSTimeInterval startedTime; +@property (copy, nonatomic, nullable) SDWebImagePrefetcherCompletionBlock completionBlock; +@property (copy, nonatomic, nullable) SDWebImagePrefetcherProgressBlock progressBlock; + +@end + +@implementation SDWebImagePrefetcher + ++ (nonnull instancetype)sharedImagePrefetcher { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (nonnull instancetype)init { + return [self initWithImageManager:[SDWebImageManager new]]; +} + +- (nonnull instancetype)initWithImageManager:(SDWebImageManager *)manager { + if ((self = [super init])) { + _manager = manager; + _options = SDWebImageLowPriority; + _prefetcherQueue = dispatch_get_main_queue(); + self.maxConcurrentDownloads = 3; + } + return self; +} + +- (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads { + self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads; +} + +- (NSUInteger)maxConcurrentDownloads { + return self.manager.imageDownloader.maxConcurrentDownloads; +} + +- (void)startPrefetchingAtIndex:(NSUInteger)index { + if (index >= self.prefetchURLs.count) return; + self.requestedCount++; + [self.manager loadImageWithURL:self.prefetchURLs[index] options:self.options progress:nil completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!finished) return; + self.finishedCount++; + + if (image) { + if (self.progressBlock) { + self.progressBlock(self.finishedCount,(self.prefetchURLs).count); + } + } + else { + if (self.progressBlock) { + self.progressBlock(self.finishedCount,(self.prefetchURLs).count); + } + // Add last failed + self.skippedCount++; + } + if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) { + [self.delegate imagePrefetcher:self + didPrefetchURL:self.prefetchURLs[index] + finishedCount:self.finishedCount + totalCount:self.prefetchURLs.count + ]; + } + if (self.prefetchURLs.count > self.requestedCount) { + dispatch_async(self.prefetcherQueue, ^{ + [self startPrefetchingAtIndex:self.requestedCount]; + }); + } else if (self.finishedCount == self.requestedCount) { + [self reportStatus]; + if (self.completionBlock) { + self.completionBlock(self.finishedCount, self.skippedCount); + self.completionBlock = nil; + } + self.progressBlock = nil; + } + }]; +} + +- (void)reportStatus { + NSUInteger total = (self.prefetchURLs).count; + if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) { + [self.delegate imagePrefetcher:self + didFinishWithTotalCount:(total - self.skippedCount) + skippedCount:self.skippedCount + ]; + } +} + +- (void)prefetchURLs:(nullable NSArray *)urls { + [self prefetchURLs:urls progress:nil completed:nil]; +} + +- (void)prefetchURLs:(nullable NSArray *)urls + progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock + completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock { + [self cancelPrefetching]; // Prevent duplicate prefetch request + self.startedTime = CFAbsoluteTimeGetCurrent(); + self.prefetchURLs = urls; + self.completionBlock = completionBlock; + self.progressBlock = progressBlock; + + if (urls.count == 0) { + if (completionBlock) { + completionBlock(0,0); + } + } else { + // Starts prefetching from the very first image on the list with the max allowed concurrency + NSUInteger listCount = self.prefetchURLs.count; + for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) { + [self startPrefetchingAtIndex:i]; + } + } +} + +- (void)cancelPrefetching { + self.prefetchURLs = nil; + self.skippedCount = 0; + self.requestedCount = 0; + self.finishedCount = 0; + [self.manager cancelAll]; +} + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h b/client/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h new file mode 100644 index 00000000..b6c4a2a2 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h @@ -0,0 +1,255 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +#if SD_UIKIT + +#import "SDWebImageManager.h" + +/** + * Integrates SDWebImage async downloading and caching of remote images with UIButtonView. + */ +@interface UIButton (WebCache) + +#pragma mark - Image + +/** + * Get the current image URL. + */ +- (nullable NSURL *)sd_currentImageURL; + +/** + * Get the image URL for a control state. + * + * @param state Which state you want to know the URL for. The values are described in UIControlState. + */ +- (nullable NSURL *)sd_imageURLForState:(UIControlState)state; + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state NS_REFINED_FOR_SWIFT; + +/** + * Set the imageView `image` with an `url` and a placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @see sd_setImageWithURL:placeholderImage:options: + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + completed:(nullable SDExternalCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + placeholderImage:(nullable UIImage *)placeholder + completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + completed:(nullable SDExternalCompletionBlock)completedBlock; + +#pragma mark - Background image + +/** + * Get the current background image URL. + */ +- (nullable NSURL *)sd_currentBackgroundImageURL; + +/** + * Get the background image URL for a control state. + * + * @param state Which state you want to know the URL for. The values are described in UIControlState. + */ +- (nullable NSURL *)sd_backgroundImageURLForState:(UIControlState)state; + +/** + * Set the backgroundImageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + */ +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state NS_REFINED_FOR_SWIFT; + +/** + * Set the backgroundImageView `image` with an `url` and a placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @see sd_setImageWithURL:placeholderImage:options: + */ +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; + +/** + * Set the backgroundImageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; + +/** + * Set the backgroundImageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + completed:(nullable SDExternalCompletionBlock)completedBlock; + +/** + * Set the backgroundImageView `image` with an `url`, placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + placeholderImage:(nullable UIImage *)placeholder + completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; + +/** + * Set the backgroundImageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + completed:(nullable SDExternalCompletionBlock)completedBlock; + +#pragma mark - Cancel + +/** + * Cancel the current image download + */ +- (void)sd_cancelImageLoadForState:(UIControlState)state; + +/** + * Cancel the current backgroundImage download + */ +- (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state; + +@end + +#endif diff --git a/client/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m b/client/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m new file mode 100644 index 00000000..7c861e81 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m @@ -0,0 +1,177 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIButton+WebCache.h" + +#if SD_UIKIT + +#import "objc/runtime.h" +#import "UIView+WebCacheOperation.h" +#import "UIView+WebCache.h" + +static char imageURLStorageKey; + +typedef NSMutableDictionary SDStateImageURLDictionary; + +static inline NSString * imageURLKeyForState(UIControlState state) { + return [NSString stringWithFormat:@"image_%lu", (unsigned long)state]; +} + +static inline NSString * backgroundImageURLKeyForState(UIControlState state) { + return [NSString stringWithFormat:@"backgroundImage_%lu", (unsigned long)state]; +} + +@implementation UIButton (WebCache) + +#pragma mark - Image + +- (nullable NSURL *)sd_currentImageURL { + NSURL *url = self.imageURLStorage[imageURLKeyForState(self.state)]; + + if (!url) { + url = self.imageURLStorage[imageURLKeyForState(UIControlStateNormal)]; + } + + return url; +} + +- (nullable NSURL *)sd_imageURLForState:(UIControlState)state { + return self.imageURLStorage[imageURLKeyForState(state)]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state { + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state completed:(nullable SDExternalCompletionBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + completed:(nullable SDExternalCompletionBlock)completedBlock { + if (!url) { + [self.imageURLStorage removeObjectForKey:imageURLKeyForState(state)]; + } else { + self.imageURLStorage[imageURLKeyForState(state)] = url; + } + + __weak typeof(self)weakSelf = self; + [self sd_internalSetImageWithURL:url + placeholderImage:placeholder + options:options + operationKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)] + setImageBlock:^(UIImage *image, NSData *imageData) { + [weakSelf setImage:image forState:state]; + } + progress:nil + completed:completedBlock]; +} + +#pragma mark - Background image + +- (nullable NSURL *)sd_currentBackgroundImageURL { + NSURL *url = self.imageURLStorage[backgroundImageURLKeyForState(self.state)]; + + if (!url) { + url = self.imageURLStorage[backgroundImageURLKeyForState(UIControlStateNormal)]; + } + + return url; +} + +- (nullable NSURL *)sd_backgroundImageURLForState:(UIControlState)state { + return self.imageURLStorage[backgroundImageURLKeyForState(state)]; +} + +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; +} + +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; +} + +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; +} + +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state completed:(nullable SDExternalCompletionBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; +} + +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; +} + +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url + forState:(UIControlState)state + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + completed:(nullable SDExternalCompletionBlock)completedBlock { + if (!url) { + [self.imageURLStorage removeObjectForKey:backgroundImageURLKeyForState(state)]; + } else { + self.imageURLStorage[backgroundImageURLKeyForState(state)] = url; + } + + __weak typeof(self)weakSelf = self; + [self sd_internalSetImageWithURL:url + placeholderImage:placeholder + options:options + operationKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)] + setImageBlock:^(UIImage *image, NSData *imageData) { + [weakSelf setBackgroundImage:image forState:state]; + } + progress:nil + completed:completedBlock]; +} + +- (void)sd_setImageLoadOperation:(id)operation forState:(UIControlState)state { + [self sd_setImageLoadOperation:operation forKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]]; +} + +- (void)sd_cancelImageLoadForState:(UIControlState)state { + [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]]; +} + +- (void)sd_setBackgroundImageLoadOperation:(id)operation forState:(UIControlState)state { + [self sd_setImageLoadOperation:operation forKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]]; +} + +- (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state { + [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]]; +} + +- (SDStateImageURLDictionary *)imageURLStorage { + SDStateImageURLDictionary *storage = objc_getAssociatedObject(self, &imageURLStorageKey); + if (!storage) { + storage = [NSMutableDictionary dictionary]; + objc_setAssociatedObject(self, &imageURLStorageKey, storage, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + + return storage; +} + +@end + +#endif diff --git a/client/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h b/client/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h new file mode 100644 index 00000000..708c37b0 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h @@ -0,0 +1,17 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +@interface UIImage (ForceDecode) + ++ (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image; + ++ (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m b/client/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m new file mode 100644 index 00000000..ee55aee7 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m @@ -0,0 +1,30 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIImage+ForceDecode.h" +#import "SDWebImageCodersManager.h" + +@implementation UIImage (ForceDecode) + ++ (UIImage *)decodedImageWithImage:(UIImage *)image { + if (!image) { + return nil; + } + NSData *tempData; + return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(NO)}]; +} + ++ (UIImage *)decodedAndScaledDownImageWithImage:(UIImage *)image { + if (!image) { + return nil; + } + NSData *tempData; + return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(YES)}]; +} + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/UIImage+GIF.h b/client/Pods/SDWebImage/SDWebImage/UIImage+GIF.h new file mode 100755 index 00000000..a3a66465 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIImage+GIF.h @@ -0,0 +1,25 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * (c) Laurin Brandner + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +@interface UIImage (GIF) + +/** + * Creates an animated UIImage from an NSData. + * For static GIF, will create an UIImage with `images` array set to nil. For animated GIF, will create an UIImage with valid `images` array. + */ ++ (UIImage *)sd_animatedGIFWithData:(NSData *)data; + +/** + * Checks if an UIImage instance is a GIF. Will use the `images` array. + */ +- (BOOL)isGIF; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/UIImage+GIF.m b/client/Pods/SDWebImage/SDWebImage/UIImage+GIF.m new file mode 100755 index 00000000..6fbca7ae --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIImage+GIF.m @@ -0,0 +1,27 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * (c) Laurin Brandner + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIImage+GIF.h" +#import "SDWebImageGIFCoder.h" +#import "NSImage+WebCache.h" + +@implementation UIImage (GIF) + ++ (UIImage *)sd_animatedGIFWithData:(NSData *)data { + if (!data) { + return nil; + } + return [[SDWebImageGIFCoder sharedCoder] decodedImageWithData:data]; +} + +- (BOOL)isGIF { + return (self.images != nil); +} + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h b/client/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h new file mode 100644 index 00000000..c0792d1b --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h @@ -0,0 +1,30 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" +#import "NSData+ImageContentType.h" + +@interface UIImage (MultiFormat) + +/** + * UIKit: + * For static image format, this value is always 0. + * For animated image format, 0 means infinite looping. + * Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods. + * AppKit: + * NSImage currently only support animated via GIF imageRep unlike UIImage. + * The getter of this property will get the loop count from GIF imageRep + * The setter of this property will set the loop count from GIF imageRep + */ +@property (nonatomic, assign) NSUInteger sd_imageLoopCount; + ++ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data; +- (nullable NSData *)sd_imageData; +- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat; + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m b/client/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m new file mode 100644 index 00000000..664e0969 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m @@ -0,0 +1,73 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIImage+MultiFormat.h" + +#import "objc/runtime.h" +#import "SDWebImageCodersManager.h" + +@implementation UIImage (MultiFormat) + +#if SD_MAC +- (NSUInteger)sd_imageLoopCount { + NSUInteger imageLoopCount = 0; + for (NSImageRep *rep in self.representations) { + if ([rep isKindOfClass:[NSBitmapImageRep class]]) { + NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; + imageLoopCount = [[bitmapRep valueForProperty:NSImageLoopCount] unsignedIntegerValue]; + break; + } + } + return imageLoopCount; +} + +- (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount { + for (NSImageRep *rep in self.representations) { + if ([rep isKindOfClass:[NSBitmapImageRep class]]) { + NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; + [bitmapRep setProperty:NSImageLoopCount withValue:@(sd_imageLoopCount)]; + break; + } + } +} + +#else + +- (NSUInteger)sd_imageLoopCount { + NSUInteger imageLoopCount = 0; + NSNumber *value = objc_getAssociatedObject(self, @selector(sd_imageLoopCount)); + if ([value isKindOfClass:[NSNumber class]]) { + imageLoopCount = value.unsignedIntegerValue; + } + return imageLoopCount; +} + +- (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount { + NSNumber *value = @(sd_imageLoopCount); + objc_setAssociatedObject(self, @selector(sd_imageLoopCount), value, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} +#endif + ++ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data { + return [[SDWebImageCodersManager sharedInstance] decodedImageWithData:data]; +} + +- (nullable NSData *)sd_imageData { + return [self sd_imageDataAsFormat:SDImageFormatUndefined]; +} + +- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat { + NSData *imageData = nil; + if (self) { + imageData = [[SDWebImageCodersManager sharedInstance] encodedDataWithImage:self format:imageFormat]; + } + return imageData; +} + + +@end diff --git a/client/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h b/client/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h new file mode 100644 index 00000000..c806e5f2 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h @@ -0,0 +1,94 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +#if SD_UIKIT + +#import "SDWebImageManager.h" + +/** + * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. + */ +@interface UIImageView (HighlightedWebCache) + +/** + * Set the imageView `highlightedImage` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + */ +- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; + +/** + * Set the imageView `highlightedImage` with an `url` and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url + options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; + +/** + * Set the imageView `highlightedImage` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url + completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; + +/** + * Set the imageView `highlightedImage` with an `url` and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url + options:(SDWebImageOptions)options + completed:(nullable SDExternalCompletionBlock)completedBlock; + +/** + * Set the imageView `highlightedImage` with an `url` and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param progressBlock A block called while image is downloading + * @note the progress block is executed on a background queue + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url + options:(SDWebImageOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock; + +@end + +#endif diff --git a/client/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m b/client/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m new file mode 100644 index 00000000..fb13bd8b --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m @@ -0,0 +1,52 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIImageView+HighlightedWebCache.h" + +#if SD_UIKIT + +#import "UIView+WebCacheOperation.h" +#import "UIView+WebCache.h" + +@implementation UIImageView (HighlightedWebCache) + +- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url { + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; +} + +- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options { + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; +} + +- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; +} + +- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; +} + +- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url + options:(SDWebImageOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock { + __weak typeof(self)weakSelf = self; + [self sd_internalSetImageWithURL:url + placeholderImage:nil + options:options + operationKey:@"UIImageViewImageOperationHighlighted" + setImageBlock:^(UIImage *image, NSData *imageData) { + weakSelf.highlightedImage = image; + } + progress:progressBlock + completed:completedBlock]; +} + +@end + +#endif diff --git a/client/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h b/client/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h new file mode 100644 index 00000000..568ccfd0 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h @@ -0,0 +1,196 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +#if SD_UIKIT || SD_MAC + +#import "SDWebImageManager.h" + +/** + * Integrates SDWebImage async downloading and caching of remote images with UIImageView. + * + * Usage with a UITableViewCell sub-class: + * + * @code + +#import + +... + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *MyIdentifier = @"MyIdentifier"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; + + if (cell == nil) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] + autorelease]; + } + + // Here we use the provided sd_setImageWithURL: method to load the web image + // Ensure you use a placeholder image otherwise cells will be initialized with no image + [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://example.com/image.jpg"] + placeholderImage:[UIImage imageNamed:@"placeholder"]]; + + cell.textLabel.text = @"My Text"; + return cell; +} + + * @endcode + */ +@interface UIImageView (WebCache) + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; + +/** + * Set the imageView `image` with an `url` and a placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @see sd_setImageWithURL:placeholderImage:options: + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + completed:(nullable SDExternalCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + completed:(nullable SDExternalCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param progressBlock A block called while image is downloading + * @note the progress block is executed on a background queue + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url` and optionally a placeholder image. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param progressBlock A block called while image is downloading + * @note the progress block is executed on a background queue + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithPreviousCachedImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock; + +#if SD_UIKIT + +#pragma mark - Animation of multiple images + +/** + * Download an array of images and starts them in an animation loop + * + * @param arrayOfURLs An array of NSURL + */ +- (void)sd_setAnimationImagesWithURLs:(nonnull NSArray *)arrayOfURLs; + +- (void)sd_cancelCurrentAnimationImagesLoad; + +#endif + +@end + +#endif diff --git a/client/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m b/client/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m new file mode 100644 index 00000000..4e5908f9 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m @@ -0,0 +1,119 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIImageView+WebCache.h" + +#if SD_UIKIT || SD_MAC + +#import "objc/runtime.h" +#import "UIView+WebCacheOperation.h" +#import "UIView+WebCache.h" + +@implementation UIImageView (WebCache) + +- (void)sd_setImageWithURL:(nullable NSURL *)url { + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder { + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock { + [self sd_internalSetImageWithURL:url + placeholderImage:placeholder + options:options + operationKey:nil + setImageBlock:nil + progress:progressBlock + completed:completedBlock]; +} + +- (void)sd_setImageWithPreviousCachedImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock { + NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url]; + UIImage *lastPreviousCachedImage = [[SDImageCache sharedImageCache] imageFromCacheForKey:key]; + + [self sd_setImageWithURL:url placeholderImage:lastPreviousCachedImage ?: placeholder options:options progress:progressBlock completed:completedBlock]; +} + +#if SD_UIKIT + +#pragma mark - Animation of multiple images + +- (void)sd_setAnimationImagesWithURLs:(nonnull NSArray *)arrayOfURLs { + [self sd_cancelCurrentAnimationImagesLoad]; + __weak __typeof(self)wself = self; + + NSMutableArray> *operationsArray = [[NSMutableArray alloc] init]; + + [arrayOfURLs enumerateObjectsUsingBlock:^(NSURL *logoImageURL, NSUInteger idx, BOOL * _Nonnull stop) { + id operation = [SDWebImageManager.sharedManager loadImageWithURL:logoImageURL options:0 progress:nil completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!wself) return; + dispatch_main_async_safe(^{ + __strong UIImageView *sself = wself; + [sself stopAnimating]; + if (sself && image) { + NSMutableArray *currentImages = [[sself animationImages] mutableCopy]; + if (!currentImages) { + currentImages = [[NSMutableArray alloc] init]; + } + + // We know what index objects should be at when they are returned so + // we will put the object at the index, filling any empty indexes + // with the image that was returned too "early". These images will + // be overwritten. (does not require additional sorting datastructure) + while ([currentImages count] < idx) { + [currentImages addObject:image]; + } + + currentImages[idx] = image; + + sself.animationImages = currentImages; + [sself setNeedsLayout]; + } + [sself startAnimating]; + }); + }]; + [operationsArray addObject:operation]; + }]; + + [self sd_setImageLoadOperation:[operationsArray copy] forKey:@"UIImageViewAnimationImages"]; +} + +- (void)sd_cancelCurrentAnimationImagesLoad { + [self sd_cancelImageLoadOperationWithKey:@"UIImageViewAnimationImages"]; +} +#endif + +@end + +#endif diff --git a/client/Pods/SDWebImage/SDWebImage/UIView+WebCache.h b/client/Pods/SDWebImage/SDWebImage/UIView+WebCache.h new file mode 100644 index 00000000..00678374 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIView+WebCache.h @@ -0,0 +1,112 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +#if SD_UIKIT || SD_MAC + +#import "SDWebImageManager.h" + +FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageInternalSetImageInGlobalQueueKey; + +typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable imageData); + +@interface UIView (WebCache) + +/** + * Get the current image URL. + * + * Note that because of the limitations of categories this property can get out of sync + * if you use setImage: directly. + */ +- (nullable NSURL *)sd_imageURL; + +/** + * Set the imageView `image` with an `url` and optionally a placeholder image. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param operationKey A string to be used as the operation key. If nil, will use the class name + * @param setImageBlock Block used for custom set image code + * @param progressBlock A block called while image is downloading + * @note the progress block is executed on a background queue + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_internalSetImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + operationKey:(nullable NSString *)operationKey + setImageBlock:(nullable SDSetImageBlock)setImageBlock + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url` and optionally a placeholder image. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param operationKey A string to be used as the operation key. If nil, will use the class name + * @param setImageBlock Block used for custom set image code + * @param progressBlock A block called while image is downloading + * @note the progress block is executed on a background queue + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + * @param context A context with extra information to perform specify changes or processes. + */ +- (void)sd_internalSetImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + operationKey:(nullable NSString *)operationKey + setImageBlock:(nullable SDSetImageBlock)setImageBlock + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock + context:(nullable NSDictionary *)context; + +/** + * Cancel the current download + */ +- (void)sd_cancelCurrentImageLoad; + +#if SD_UIKIT + +#pragma mark - Activity indicator + +/** + * Show activity UIActivityIndicatorView + */ +- (void)sd_setShowActivityIndicatorView:(BOOL)show; + +/** + * set desired UIActivityIndicatorViewStyle + * + * @param style The style of the UIActivityIndicatorView + */ +- (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style; + +- (BOOL)sd_showActivityIndicatorView; +- (void)sd_addActivityIndicator; +- (void)sd_removeActivityIndicator; + +#endif + +@end + +#endif diff --git a/client/Pods/SDWebImage/SDWebImage/UIView+WebCache.m b/client/Pods/SDWebImage/SDWebImage/UIView+WebCache.m new file mode 100644 index 00000000..b3734be4 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIView+WebCache.m @@ -0,0 +1,232 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIView+WebCache.h" + +#if SD_UIKIT || SD_MAC + +#import "objc/runtime.h" +#import "UIView+WebCacheOperation.h" + +NSString * const SDWebImageInternalSetImageInGlobalQueueKey = @"setImageInGlobalQueue"; + +static char imageURLKey; + +#if SD_UIKIT +static char TAG_ACTIVITY_INDICATOR; +static char TAG_ACTIVITY_STYLE; +#endif +static char TAG_ACTIVITY_SHOW; + +@implementation UIView (WebCache) + +- (nullable NSURL *)sd_imageURL { + return objc_getAssociatedObject(self, &imageURLKey); +} + +- (void)sd_internalSetImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + operationKey:(nullable NSString *)operationKey + setImageBlock:(nullable SDSetImageBlock)setImageBlock + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock { + return [self sd_internalSetImageWithURL:url placeholderImage:placeholder options:options operationKey:operationKey setImageBlock:setImageBlock progress:progressBlock completed:completedBlock context:nil]; +} + +- (void)sd_internalSetImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + operationKey:(nullable NSString *)operationKey + setImageBlock:(nullable SDSetImageBlock)setImageBlock + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock + context:(nullable NSDictionary *)context { + NSString *validOperationKey = operationKey ?: NSStringFromClass([self class]); + [self sd_cancelImageLoadOperationWithKey:validOperationKey]; + objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + + if (!(options & SDWebImageDelayPlaceholder)) { + dispatch_main_async_safe(^{ + [self sd_setImage:placeholder imageData:nil basedOnClassOrViaCustomSetImageBlock:setImageBlock]; + }); + } + + if (url) { + // check if activityView is enabled or not + if ([self sd_showActivityIndicatorView]) { + [self sd_addActivityIndicator]; + } + + __weak __typeof(self)wself = self; + id operation = [SDWebImageManager.sharedManager loadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + __strong __typeof (wself) sself = wself; + [sself sd_removeActivityIndicator]; + if (!sself) { return; } + BOOL shouldCallCompletedBlock = finished || (options & SDWebImageAvoidAutoSetImage); + BOOL shouldNotSetImage = ((image && (options & SDWebImageAvoidAutoSetImage)) || + (!image && !(options & SDWebImageDelayPlaceholder))); + SDWebImageNoParamsBlock callCompletedBlockClojure = ^{ + if (!sself) { return; } + if (!shouldNotSetImage) { + [sself sd_setNeedsLayout]; + } + if (completedBlock && shouldCallCompletedBlock) { + completedBlock(image, error, cacheType, url); + } + }; + + // case 1a: we got an image, but the SDWebImageAvoidAutoSetImage flag is set + // OR + // case 1b: we got no image and the SDWebImageDelayPlaceholder is not set + if (shouldNotSetImage) { + dispatch_main_async_safe(callCompletedBlockClojure); + return; + } + + UIImage *targetImage = nil; + NSData *targetData = nil; + if (image) { + // case 2a: we got an image and the SDWebImageAvoidAutoSetImage is not set + targetImage = image; + targetData = data; + } else if (options & SDWebImageDelayPlaceholder) { + // case 2b: we got no image and the SDWebImageDelayPlaceholder flag is set + targetImage = placeholder; + targetData = nil; + } + BOOL shouldUseGlobalQueue = NO; + if (context && [context valueForKey:SDWebImageInternalSetImageInGlobalQueueKey]) { + shouldUseGlobalQueue = [[context valueForKey:SDWebImageInternalSetImageInGlobalQueueKey] boolValue]; + } + dispatch_queue_t targetQueue = shouldUseGlobalQueue ? dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0) : dispatch_get_main_queue(); + + dispatch_queue_async_safe(targetQueue, ^{ + [sself sd_setImage:targetImage imageData:targetData basedOnClassOrViaCustomSetImageBlock:setImageBlock]; + dispatch_main_async_safe(callCompletedBlockClojure); + }); + }]; + [self sd_setImageLoadOperation:operation forKey:validOperationKey]; + } else { + dispatch_main_async_safe(^{ + [self sd_removeActivityIndicator]; + if (completedBlock) { + NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; + completedBlock(nil, error, SDImageCacheTypeNone, url); + } + }); + } +} + +- (void)sd_cancelCurrentImageLoad { + [self sd_cancelImageLoadOperationWithKey:NSStringFromClass([self class])]; +} + +- (void)sd_setImage:(UIImage *)image imageData:(NSData *)imageData basedOnClassOrViaCustomSetImageBlock:(SDSetImageBlock)setImageBlock { + if (setImageBlock) { + setImageBlock(image, imageData); + return; + } + +#if SD_UIKIT || SD_MAC + if ([self isKindOfClass:[UIImageView class]]) { + UIImageView *imageView = (UIImageView *)self; + imageView.image = image; + } +#endif + +#if SD_UIKIT + if ([self isKindOfClass:[UIButton class]]) { + UIButton *button = (UIButton *)self; + [button setImage:image forState:UIControlStateNormal]; + } +#endif +} + +- (void)sd_setNeedsLayout { +#if SD_UIKIT + [self setNeedsLayout]; +#elif SD_MAC + [self setNeedsLayout:YES]; +#endif +} + +#pragma mark - Activity indicator + +#pragma mark - +#if SD_UIKIT +- (UIActivityIndicatorView *)activityIndicator { + return (UIActivityIndicatorView *)objc_getAssociatedObject(self, &TAG_ACTIVITY_INDICATOR); +} + +- (void)setActivityIndicator:(UIActivityIndicatorView *)activityIndicator { + objc_setAssociatedObject(self, &TAG_ACTIVITY_INDICATOR, activityIndicator, OBJC_ASSOCIATION_RETAIN); +} +#endif + +- (void)sd_setShowActivityIndicatorView:(BOOL)show { + objc_setAssociatedObject(self, &TAG_ACTIVITY_SHOW, @(show), OBJC_ASSOCIATION_RETAIN); +} + +- (BOOL)sd_showActivityIndicatorView { + return [objc_getAssociatedObject(self, &TAG_ACTIVITY_SHOW) boolValue]; +} + +#if SD_UIKIT +- (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style{ + objc_setAssociatedObject(self, &TAG_ACTIVITY_STYLE, [NSNumber numberWithInt:style], OBJC_ASSOCIATION_RETAIN); +} + +- (int)sd_getIndicatorStyle{ + return [objc_getAssociatedObject(self, &TAG_ACTIVITY_STYLE) intValue]; +} +#endif + +- (void)sd_addActivityIndicator { +#if SD_UIKIT + dispatch_main_async_safe(^{ + if (!self.activityIndicator) { + self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:[self sd_getIndicatorStyle]]; + self.activityIndicator.translatesAutoresizingMaskIntoConstraints = NO; + + [self addSubview:self.activityIndicator]; + + [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator + attribute:NSLayoutAttributeCenterX + relatedBy:NSLayoutRelationEqual + toItem:self + attribute:NSLayoutAttributeCenterX + multiplier:1.0 + constant:0.0]]; + [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator + attribute:NSLayoutAttributeCenterY + relatedBy:NSLayoutRelationEqual + toItem:self + attribute:NSLayoutAttributeCenterY + multiplier:1.0 + constant:0.0]]; + } + [self.activityIndicator startAnimating]; + }); +#endif +} + +- (void)sd_removeActivityIndicator { +#if SD_UIKIT + dispatch_main_async_safe(^{ + if (self.activityIndicator) { + [self.activityIndicator removeFromSuperview]; + self.activityIndicator = nil; + } + }); +#endif +} + +@end + +#endif diff --git a/client/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h b/client/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h new file mode 100644 index 00000000..f5e95fa6 --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h @@ -0,0 +1,41 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +#if SD_UIKIT || SD_MAC + +#import "SDWebImageManager.h" + +@interface UIView (WebCacheOperation) + +/** + * Set the image load operation (storage in a UIView based dictionary) + * + * @param operation the operation + * @param key key for storing the operation + */ +- (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; + +/** + * Cancel all operations for the current UIView and key + * + * @param key key for identifying the operations + */ +- (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; + +/** + * Just remove the operations corresponding to the current UIView and key without cancelling them + * + * @param key key for identifying the operations + */ +- (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; + +@end + +#endif diff --git a/client/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m b/client/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m new file mode 100644 index 00000000..a515a74f --- /dev/null +++ b/client/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m @@ -0,0 +1,68 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIView+WebCacheOperation.h" + +#if SD_UIKIT || SD_MAC + +#import "objc/runtime.h" + +static char loadOperationKey; + +typedef NSMutableDictionary SDOperationsDictionary; + +@implementation UIView (WebCacheOperation) + +- (SDOperationsDictionary *)operationDictionary { + SDOperationsDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); + if (operations) { + return operations; + } + operations = [NSMutableDictionary dictionary]; + objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + return operations; +} + +- (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key { + if (key) { + [self sd_cancelImageLoadOperationWithKey:key]; + if (operation) { + SDOperationsDictionary *operationDictionary = [self operationDictionary]; + operationDictionary[key] = operation; + } + } +} + +- (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key { + // Cancel in progress downloader from queue + SDOperationsDictionary *operationDictionary = [self operationDictionary]; + id operations = operationDictionary[key]; + if (operations) { + if ([operations isKindOfClass:[NSArray class]]) { + for (id operation in operations) { + if (operation) { + [operation cancel]; + } + } + } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ + [(id) operations cancel]; + } + [operationDictionary removeObjectForKey:key]; + } +} + +- (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key { + if (key) { + SDOperationsDictionary *operationDictionary = [self operationDictionary]; + [operationDictionary removeObjectForKey:key]; + } +} + +@end + +#endif diff --git a/client/Pods/Target Support Files/Alamofire/Alamofire-dummy.m b/client/Pods/Target Support Files/Alamofire/Alamofire-dummy.m new file mode 100644 index 00000000..a6c45942 --- /dev/null +++ b/client/Pods/Target Support Files/Alamofire/Alamofire-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Alamofire : NSObject +@end +@implementation PodsDummy_Alamofire +@end diff --git a/client/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/client/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch new file mode 100644 index 00000000..beb2a244 --- /dev/null +++ b/client/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/client/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/client/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h new file mode 100644 index 00000000..00014e3c --- /dev/null +++ b/client/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double AlamofireVersionNumber; +FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; + diff --git a/client/Pods/Target Support Files/Alamofire/Alamofire.modulemap b/client/Pods/Target Support Files/Alamofire/Alamofire.modulemap new file mode 100644 index 00000000..d1f125fa --- /dev/null +++ b/client/Pods/Target Support Files/Alamofire/Alamofire.modulemap @@ -0,0 +1,6 @@ +framework module Alamofire { + umbrella header "Alamofire-umbrella.h" + + export * + module * { export * } +} diff --git a/client/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/client/Pods/Target Support Files/Alamofire/Alamofire.xcconfig new file mode 100644 index 00000000..619e5f4a --- /dev/null +++ b/client/Pods/Target Support Files/Alamofire/Alamofire.xcconfig @@ -0,0 +1,10 @@ +CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Alamofire +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/client/Pods/Target Support Files/Alamofire/Info.plist b/client/Pods/Target Support Files/Alamofire/Info.plist new file mode 100644 index 00000000..eaa7c2e9 --- /dev/null +++ b/client/Pods/Target Support Files/Alamofire/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 4.5.1 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-dummy.m b/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-dummy.m new file mode 100644 index 00000000..1868e9da --- /dev/null +++ b/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_FontAwesome_swift : NSObject +@end +@implementation PodsDummy_FontAwesome_swift +@end diff --git a/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-prefix.pch b/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-prefix.pch new file mode 100644 index 00000000..beb2a244 --- /dev/null +++ b/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-umbrella.h b/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-umbrella.h new file mode 100644 index 00000000..602d1bf1 --- /dev/null +++ b/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double FontAwesome_swiftVersionNumber; +FOUNDATION_EXPORT const unsigned char FontAwesome_swiftVersionString[]; + diff --git a/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift.modulemap b/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift.modulemap new file mode 100644 index 00000000..9f021dd4 --- /dev/null +++ b/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift.modulemap @@ -0,0 +1,6 @@ +framework module FontAwesome_swift { + umbrella header "FontAwesome.swift-umbrella.h" + + export * + module * { export * } +} diff --git a/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift.xcconfig b/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift.xcconfig new file mode 100644 index 00000000..0ae68753 --- /dev/null +++ b/client/Pods/Target Support Files/FontAwesome.swift/FontAwesome.swift.xcconfig @@ -0,0 +1,11 @@ +CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "CoreText" -framework "UIKit" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/FontAwesome.swift +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/client/Pods/Target Support Files/FontAwesome.swift/Info.plist b/client/Pods/Target Support Files/FontAwesome.swift/Info.plist new file mode 100644 index 00000000..6c1d64f1 --- /dev/null +++ b/client/Pods/Target Support Files/FontAwesome.swift/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.3.2 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/client/Pods/Target Support Files/FontAwesome.swift/ResourceBundle-FontAwesome.swift-Info.plist b/client/Pods/Target Support Files/FontAwesome.swift/ResourceBundle-FontAwesome.swift-Info.plist new file mode 100644 index 00000000..7a2a9034 --- /dev/null +++ b/client/Pods/Target Support Files/FontAwesome.swift/ResourceBundle-FontAwesome.swift-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.3.2 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/client/Pods/Target Support Files/Moya/Info.plist b/client/Pods/Target Support Files/Moya/Info.plist new file mode 100644 index 00000000..a451985e --- /dev/null +++ b/client/Pods/Target Support Files/Moya/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 10.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/client/Pods/Target Support Files/Moya/Moya-dummy.m b/client/Pods/Target Support Files/Moya/Moya-dummy.m new file mode 100644 index 00000000..260473f2 --- /dev/null +++ b/client/Pods/Target Support Files/Moya/Moya-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Moya : NSObject +@end +@implementation PodsDummy_Moya +@end diff --git a/client/Pods/Target Support Files/Moya/Moya-prefix.pch b/client/Pods/Target Support Files/Moya/Moya-prefix.pch new file mode 100644 index 00000000..beb2a244 --- /dev/null +++ b/client/Pods/Target Support Files/Moya/Moya-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/client/Pods/Target Support Files/Moya/Moya-umbrella.h b/client/Pods/Target Support Files/Moya/Moya-umbrella.h new file mode 100644 index 00000000..8d810473 --- /dev/null +++ b/client/Pods/Target Support Files/Moya/Moya-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double MoyaVersionNumber; +FOUNDATION_EXPORT const unsigned char MoyaVersionString[]; + diff --git a/client/Pods/Target Support Files/Moya/Moya.modulemap b/client/Pods/Target Support Files/Moya/Moya.modulemap new file mode 100644 index 00000000..7b84cdb9 --- /dev/null +++ b/client/Pods/Target Support Files/Moya/Moya.modulemap @@ -0,0 +1,6 @@ +framework module Moya { + umbrella header "Moya-umbrella.h" + + export * + module * { export * } +} diff --git a/client/Pods/Target Support Files/Moya/Moya.xcconfig b/client/Pods/Target Support Files/Moya/Moya.xcconfig new file mode 100644 index 00000000..a9a06825 --- /dev/null +++ b/client/Pods/Target Support Files/Moya/Moya.xcconfig @@ -0,0 +1,12 @@ +CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Moya +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Result" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "Foundation" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Moya +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/client/Pods/Target Support Files/Pods-CoolCards/Info.plist b/client/Pods/Target Support Files/Pods-CoolCards/Info.plist new file mode 100644 index 00000000..2243fe6e --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCards/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-acknowledgements.markdown b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-acknowledgements.markdown new file mode 100644 index 00000000..6d975df5 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-acknowledgements.markdown @@ -0,0 +1,122 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## Alamofire + +Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +## FontAwesome.swift + +Copyright (c) 2014-present FontAwesome.swift contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +## Moya + +The MIT License (MIT) + +Copyright (c) 2017 Artsy, Ash Furrow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +## Result + +The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +## SDWebImage + +Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +Generated by CocoaPods - https://cocoapods.org diff --git a/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-acknowledgements.plist b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-acknowledgements.plist new file mode 100644 index 00000000..18b71080 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-acknowledgements.plist @@ -0,0 +1,178 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + Alamofire + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2014-present FontAwesome.swift contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + FontAwesome.swift + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2017 Artsy, Ash Furrow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + License + MIT + Title + Moya + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + License + MIT + Title + Result + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + + License + MIT + Title + SDWebImage + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-dummy.m b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-dummy.m new file mode 100644 index 00000000..9c74ed50 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_CoolCards : NSObject +@end +@implementation PodsDummy_Pods_CoolCards +@end diff --git a/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-frameworks.sh b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-frameworks.sh new file mode 100755 index 00000000..e09bc411 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-frameworks.sh @@ -0,0 +1,120 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FontAwesome.swift/FontAwesome_swift.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Moya/Moya.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Result/Result.framework" + install_framework "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FontAwesome.swift/FontAwesome_swift.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Moya/Moya.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Result/Result.framework" + install_framework "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-resources.sh b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-resources.sh new file mode 100755 index 00000000..a7df4405 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-resources.sh @@ -0,0 +1,106 @@ +#!/bin/sh +set -e + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-umbrella.h b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-umbrella.h new file mode 100644 index 00000000..806c56a7 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_CoolCardsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_CoolCardsVersionString[]; + diff --git a/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.debug.xcconfig b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.debug.xcconfig new file mode 100644 index 00000000..cc8172a1 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.debug.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift/FontAwesome_swift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage/SDWebImage.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "FontAwesome_swift" -framework "Moya" -framework "Result" -framework "SDWebImage" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.modulemap b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.modulemap new file mode 100644 index 00000000..3f2919c5 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.modulemap @@ -0,0 +1,6 @@ +framework module Pods_CoolCards { + umbrella header "Pods-CoolCards-umbrella.h" + + export * + module * { export * } +} diff --git a/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.release.xcconfig b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.release.xcconfig new file mode 100644 index 00000000..cc8172a1 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCards/Pods-CoolCards.release.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift/FontAwesome_swift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage/SDWebImage.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "FontAwesome_swift" -framework "Moya" -framework "Result" -framework "SDWebImage" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Info.plist b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Info.plist new file mode 100644 index 00000000..2243fe6e --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-acknowledgements.markdown b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-acknowledgements.markdown new file mode 100644 index 00000000..6d975df5 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-acknowledgements.markdown @@ -0,0 +1,122 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## Alamofire + +Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +## FontAwesome.swift + +Copyright (c) 2014-present FontAwesome.swift contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +## Moya + +The MIT License (MIT) + +Copyright (c) 2017 Artsy, Ash Furrow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +## Result + +The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +## SDWebImage + +Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +Generated by CocoaPods - https://cocoapods.org diff --git a/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-acknowledgements.plist b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-acknowledgements.plist new file mode 100644 index 00000000..18b71080 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-acknowledgements.plist @@ -0,0 +1,178 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + Alamofire + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2014-present FontAwesome.swift contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + FontAwesome.swift + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2017 Artsy, Ash Furrow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + License + MIT + Title + Moya + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + License + MIT + Title + Result + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + + License + MIT + Title + SDWebImage + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-dummy.m b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-dummy.m new file mode 100644 index 00000000..e97b09d9 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_CoolCardsIntegrationTests : NSObject +@end +@implementation PodsDummy_Pods_CoolCardsIntegrationTests +@end diff --git a/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-frameworks.sh b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-frameworks.sh new file mode 100755 index 00000000..e09bc411 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-frameworks.sh @@ -0,0 +1,120 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FontAwesome.swift/FontAwesome_swift.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Moya/Moya.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Result/Result.framework" + install_framework "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FontAwesome.swift/FontAwesome_swift.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Moya/Moya.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Result/Result.framework" + install_framework "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-resources.sh b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-resources.sh new file mode 100755 index 00000000..a7df4405 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-resources.sh @@ -0,0 +1,106 @@ +#!/bin/sh +set -e + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-umbrella.h b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-umbrella.h new file mode 100644 index 00000000..aaf20e59 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_CoolCardsIntegrationTestsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_CoolCardsIntegrationTestsVersionString[]; + diff --git a/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.debug.xcconfig b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.debug.xcconfig new file mode 100644 index 00000000..cc8172a1 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.debug.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift/FontAwesome_swift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage/SDWebImage.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "FontAwesome_swift" -framework "Moya" -framework "Result" -framework "SDWebImage" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.modulemap b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.modulemap new file mode 100644 index 00000000..34d228f8 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.modulemap @@ -0,0 +1,6 @@ +framework module Pods_CoolCardsIntegrationTests { + umbrella header "Pods-CoolCardsIntegrationTests-umbrella.h" + + export * + module * { export * } +} diff --git a/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.release.xcconfig b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.release.xcconfig new file mode 100644 index 00000000..cc8172a1 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsIntegrationTests/Pods-CoolCardsIntegrationTests.release.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift/FontAwesome_swift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage/SDWebImage.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "FontAwesome_swift" -framework "Moya" -framework "Result" -framework "SDWebImage" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/client/Pods/Target Support Files/Pods-CoolCardsTests/Info.plist b/client/Pods/Target Support Files/Pods-CoolCardsTests/Info.plist new file mode 100644 index 00000000..2243fe6e --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsTests/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-acknowledgements.markdown b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-acknowledgements.markdown new file mode 100644 index 00000000..6d975df5 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-acknowledgements.markdown @@ -0,0 +1,122 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## Alamofire + +Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +## FontAwesome.swift + +Copyright (c) 2014-present FontAwesome.swift contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +## Moya + +The MIT License (MIT) + +Copyright (c) 2017 Artsy, Ash Furrow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +## Result + +The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +## SDWebImage + +Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +Generated by CocoaPods - https://cocoapods.org diff --git a/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-acknowledgements.plist b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-acknowledgements.plist new file mode 100644 index 00000000..18b71080 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-acknowledgements.plist @@ -0,0 +1,178 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + Alamofire + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2014-present FontAwesome.swift contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + FontAwesome.swift + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2017 Artsy, Ash Furrow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + License + MIT + Title + Moya + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + License + MIT + Title + Result + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + + License + MIT + Title + SDWebImage + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-dummy.m b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-dummy.m new file mode 100644 index 00000000..fd0445f7 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_CoolCardsTests : NSObject +@end +@implementation PodsDummy_Pods_CoolCardsTests +@end diff --git a/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-frameworks.sh b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-frameworks.sh new file mode 100755 index 00000000..e09bc411 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-frameworks.sh @@ -0,0 +1,120 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FontAwesome.swift/FontAwesome_swift.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Moya/Moya.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Result/Result.framework" + install_framework "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/FontAwesome.swift/FontAwesome_swift.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Moya/Moya.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Result/Result.framework" + install_framework "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-resources.sh b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-resources.sh new file mode 100755 index 00000000..a7df4405 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-resources.sh @@ -0,0 +1,106 @@ +#!/bin/sh +set -e + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-umbrella.h b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-umbrella.h new file mode 100644 index 00000000..1ee2553e --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_CoolCardsTestsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_CoolCardsTestsVersionString[]; + diff --git a/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.debug.xcconfig b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.debug.xcconfig new file mode 100644 index 00000000..cc8172a1 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.debug.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift/FontAwesome_swift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage/SDWebImage.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "FontAwesome_swift" -framework "Moya" -framework "Result" -framework "SDWebImage" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.modulemap b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.modulemap new file mode 100644 index 00000000..542592ae --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.modulemap @@ -0,0 +1,6 @@ +framework module Pods_CoolCardsTests { + umbrella header "Pods-CoolCardsTests-umbrella.h" + + export * + module * { export * } +} diff --git a/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.release.xcconfig b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.release.xcconfig new file mode 100644 index 00000000..cc8172a1 --- /dev/null +++ b/client/Pods/Target Support Files/Pods-CoolCardsTests/Pods-CoolCardsTests.release.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift" "$PODS_CONFIGURATION_BUILD_DIR/Moya" "$PODS_CONFIGURATION_BUILD_DIR/Result" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FontAwesome.swift/FontAwesome_swift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Moya/Moya.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Result/Result.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage/SDWebImage.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "FontAwesome_swift" -framework "Moya" -framework "Result" -framework "SDWebImage" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/client/Pods/Target Support Files/Result/Info.plist b/client/Pods/Target Support Files/Result/Info.plist new file mode 100644 index 00000000..b6e86dd8 --- /dev/null +++ b/client/Pods/Target Support Files/Result/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 3.2.4 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/client/Pods/Target Support Files/Result/Result-dummy.m b/client/Pods/Target Support Files/Result/Result-dummy.m new file mode 100644 index 00000000..ba47f618 --- /dev/null +++ b/client/Pods/Target Support Files/Result/Result-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Result : NSObject +@end +@implementation PodsDummy_Result +@end diff --git a/client/Pods/Target Support Files/Result/Result-prefix.pch b/client/Pods/Target Support Files/Result/Result-prefix.pch new file mode 100644 index 00000000..beb2a244 --- /dev/null +++ b/client/Pods/Target Support Files/Result/Result-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/client/Pods/Target Support Files/Result/Result-umbrella.h b/client/Pods/Target Support Files/Result/Result-umbrella.h new file mode 100644 index 00000000..25f5eb12 --- /dev/null +++ b/client/Pods/Target Support Files/Result/Result-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double ResultVersionNumber; +FOUNDATION_EXPORT const unsigned char ResultVersionString[]; + diff --git a/client/Pods/Target Support Files/Result/Result.modulemap b/client/Pods/Target Support Files/Result/Result.modulemap new file mode 100644 index 00000000..c5e6a4a2 --- /dev/null +++ b/client/Pods/Target Support Files/Result/Result.modulemap @@ -0,0 +1,6 @@ +framework module Result { + umbrella header "Result-umbrella.h" + + export * + module * { export * } +} diff --git a/client/Pods/Target Support Files/Result/Result.xcconfig b/client/Pods/Target Support Files/Result/Result.xcconfig new file mode 100644 index 00000000..c29cedf0 --- /dev/null +++ b/client/Pods/Target Support Files/Result/Result.xcconfig @@ -0,0 +1,10 @@ +CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Result +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Result +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/client/Pods/Target Support Files/SDWebImage/Info.plist b/client/Pods/Target Support Files/SDWebImage/Info.plist new file mode 100644 index 00000000..b04e694e --- /dev/null +++ b/client/Pods/Target Support Files/SDWebImage/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 4.2.2 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/client/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m b/client/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m new file mode 100644 index 00000000..86d2b5f6 --- /dev/null +++ b/client/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_SDWebImage : NSObject +@end +@implementation PodsDummy_SDWebImage +@end diff --git a/client/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch b/client/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch new file mode 100644 index 00000000..beb2a244 --- /dev/null +++ b/client/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/client/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h b/client/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h new file mode 100644 index 00000000..e16a4854 --- /dev/null +++ b/client/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h @@ -0,0 +1,40 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "NSData+ImageContentType.h" +#import "NSImage+WebCache.h" +#import "SDImageCache.h" +#import "SDImageCacheConfig.h" +#import "SDWebImageCoder.h" +#import "SDWebImageCoderHelper.h" +#import "SDWebImageCodersManager.h" +#import "SDWebImageCompat.h" +#import "SDWebImageDownloader.h" +#import "SDWebImageDownloaderOperation.h" +#import "SDWebImageFrame.h" +#import "SDWebImageGIFCoder.h" +#import "SDWebImageImageIOCoder.h" +#import "SDWebImageManager.h" +#import "SDWebImageOperation.h" +#import "SDWebImagePrefetcher.h" +#import "UIButton+WebCache.h" +#import "UIImage+ForceDecode.h" +#import "UIImage+GIF.h" +#import "UIImage+MultiFormat.h" +#import "UIImageView+HighlightedWebCache.h" +#import "UIImageView+WebCache.h" +#import "UIView+WebCache.h" +#import "UIView+WebCacheOperation.h" + +FOUNDATION_EXPORT double SDWebImageVersionNumber; +FOUNDATION_EXPORT const unsigned char SDWebImageVersionString[]; + diff --git a/client/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap b/client/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap new file mode 100644 index 00000000..91545be6 --- /dev/null +++ b/client/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap @@ -0,0 +1,6 @@ +framework module SDWebImage { + umbrella header "SDWebImage-umbrella.h" + + export * + module * { export * } +} diff --git a/client/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig b/client/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig new file mode 100644 index 00000000..60359db8 --- /dev/null +++ b/client/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig @@ -0,0 +1,10 @@ +CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SDWebImage +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "ImageIO" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/server/.dockerignore b/server/.dockerignore new file mode 100644 index 00000000..1a2d9195 --- /dev/null +++ b/server/.dockerignore @@ -0,0 +1,3 @@ +.env +data +__pycache__ \ No newline at end of file diff --git a/server/.gitignore b/server/.gitignore new file mode 100644 index 00000000..1a2d9195 --- /dev/null +++ b/server/.gitignore @@ -0,0 +1,3 @@ +.env +data +__pycache__ \ No newline at end of file diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 00000000..c4fad38d --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.6.2 + +ADD requirements.txt /app/ +WORKDIR /app +RUN pip install -r requirements.txt + +RUN python --version + +ADD . /app +WORKDIR /app + +RUN mkdir -p data +RUN python models.py +RUN ls data + +EXPOSE 5000 +ENTRYPOINT ["python"] +CMD [ "app.py" ] diff --git a/server/app.py b/server/app.py new file mode 100755 index 00000000..c451dabf --- /dev/null +++ b/server/app.py @@ -0,0 +1,19 @@ +#! .env/bin/python + +from flask import Flask +from flask_restful import Api +import time + +app = Flask(__name__) +api = Api(app, catch_all_404s=True) + +from resources import CardResource +from resources import CardListResource + +api.add_resource(CardListResource, '/cards', endpoint='cards') +api.add_resource(CardResource, '/card/', endpoint='card') + +if __name__ == '__main__': + from models import create_mock_database + print ("Starting Server") + app.run(host='0.0.0.0') \ No newline at end of file diff --git a/server/config.py b/server/config.py new file mode 100755 index 00000000..14ce42e8 --- /dev/null +++ b/server/config.py @@ -0,0 +1,6 @@ +#! .env/bin/python + +import os + +basedir = os.path.abspath(os.path.dirname(__file__)) +DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data/app.sqlite') diff --git a/server/db.py b/server/db.py new file mode 100755 index 00000000..b7c2fa5a --- /dev/null +++ b/server/db.py @@ -0,0 +1,11 @@ +#! .env/bin/python + +from sqlalchemy import create_engine +from sqlalchemy.orm import scoped_session +from sqlalchemy.orm import sessionmaker +from config import DATABASE_URI + +Session = sessionmaker(autocommit=False, + autoflush=False, + bind=create_engine(DATABASE_URI)) +session = scoped_session(Session) \ No newline at end of file diff --git a/server/deploy.sh b/server/deploy.sh new file mode 100755 index 00000000..c77992bc --- /dev/null +++ b/server/deploy.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Exit on any error +set -e + +set -x + +PROJECT_ID=coolcards-12345 +PROJECT_NAME=coolcards +DEPLOYMENT_NAME=coolcards +PROJECT_TAG=`git rev-parse --short HEAD` +CLUSTER_NAME="staging" +CLUSTER_ZONE="europe-west1-b" +CONTAINER_NAME=coolcards +DEPLOYMENT_NAME=coolcards + +echo "This is the project name:${PROJECT_NAME}, id:${PROJECT_ID}, tag:${PROJECT_TAG}" + +DOCKER_IMAGE_NAME="gcr.io/${PROJECT_ID}/${PROJECT_NAME}:${PROJECT_TAG}" + +gcloud --quiet config set project ${PROJECT_ID} +gcloud --quiet config set container/cluster ${CLUSTER_NAME} +gcloud --quiet config set compute/zone ${CLUSTER_ZONE} +gcloud --quiet container clusters get-credentials ${CLUSTER_NAME} + +docker build -t ${DOCKER_IMAGE_NAME} -f Dockerfile . +gcloud docker -- push ${DOCKER_IMAGE_NAME} + +kubectl config current-context +kubectl set image deployment/${DEPLOYMENT_NAME} ${CONTAINER_NAME}=${DOCKER_IMAGE_NAME} diff --git a/server/docker-compose.yml b/server/docker-compose.yml new file mode 100644 index 00000000..d2725f7e --- /dev/null +++ b/server/docker-compose.yml @@ -0,0 +1,5 @@ +server: + build: . + container_name: server + ports: + - "5000:5000" \ No newline at end of file diff --git a/server/examples/card1.json b/server/examples/card1.json new file mode 100644 index 00000000..94d8f8d4 --- /dev/null +++ b/server/examples/card1.json @@ -0,0 +1,21 @@ +{ + "cardId": "FP1_014", + "name": "Stalagg", + "cardSet": "Naxxramas", + "type": "Minion", + "rarity": "Legendary", + "cost": 5, + "attack": 7, + "health": 4, + "text": "Deathrattle: If Feugen also died this game, summon Thaddius.", + "flavor": "Stalagg want to write own flavor text. \"STALAGG AWESOME!\"", + "artist": "Dany Orizio", + "collectible": true, + "elite": true, + "playerClass": "Neutral", + "howToGet": "Unlocked in The Construct Quarter, in the Naxxramas adventure.", + "howToGetGold": "Crafting unlocked in The Construct Quarter, in the Naxxramas adventure.", + "img": "http://wow.zamimg.com/images/hearthstone/cards/enus/original/FP1_014.png", + "imgGold": "http://wow.zamimg.com/images/hearthstone/cards/enus/animated/FP1_014_premium.gif", + "locale": "enUS" +} \ No newline at end of file diff --git a/server/examples/card2.json b/server/examples/card2.json new file mode 100644 index 00000000..fd382c41 --- /dev/null +++ b/server/examples/card2.json @@ -0,0 +1,20 @@ +{ + "cardId": "CFM_902", + "name": "Aya Blackpaw", + "cardSet": "Mean Streets of Gadgetzan", + "type": "Minion", + "rarity": "Legendary", + "cost": 6, + "attack": 5, + "health": 3, + "text": " Battlecry and Deathrattle: Summon a Jade Golem.", + "flavor": "Though young, Aya took over as the leader of Jade Lotus through her charisma and strategic acumen when her predecessor was accidentally crushed by a jade golem.", + "artist": "Glenn Rane", + "collectible": true, + "elite": true, + "playerClass": "Neutral", + "multiClassGroup": "Jade Lotus", + "img": "http://media.services.zam.com/v1/media/byName/hs/cards/enus/CFM_902.png", + "imgGold": "http://media.services.zam.com/v1/media/byName/hs/cards/enus/animated/CFM_902_premium.gif", + "locale": "enUS" +} \ No newline at end of file diff --git a/server/models.py b/server/models.py new file mode 100755 index 00000000..2d8bfe59 --- /dev/null +++ b/server/models.py @@ -0,0 +1,77 @@ +#! .env/bin/python + +from sqlalchemy import Column +from sqlalchemy import Integer +from sqlalchemy import String +from sqlalchemy import Boolean +from sqlalchemy import ForeignKey +from sqlalchemy import Table +from sqlalchemy import ARRAY +from sqlalchemy.orm import relationship +from sqlalchemy.ext.declarative import declarative_base + +import json +import random +from pprint import pprint + +Base = declarative_base() + +association_table = Table('association', Base.metadata, + Column('left_id', Integer, ForeignKey('card.cardId')), + Column('right_id', Integer, ForeignKey('cardmechanic.name')) +) + +class CardMechanic(Base): + __tablename__ = 'cardmechanic' + + name = Column(String(255), primary_key=True) + +class Card(Base): + __tablename__ = 'card' + + cardId = Column(String(255), primary_key=True) + name = Column(String(255)) + cardSet = Column(String(255)) + type = Column(String(255)) + rarity = Column(String(255)) + cost = Column(Integer) + attack = Column(Integer) + health = Column(Integer) + text = Column(String(255)) + flavor = Column(String(255)) + artist = Column(String(255)) + collectible = Column(Boolean) + elite = Column(Boolean) + playerClass = Column(String(255)) + howToGet = Column(String(255)) + howToGetGold = Column(String(255)) + multiClassGroup = Column(String(255)) + img = Column(String(255)) + imgGold = Column(String(255)) + locale = Column(String(10)) + mechanics = relationship('CardMechanic', secondary=association_table) + +def create_mock_database(): + print ("Creating Mock Database") + + from sqlalchemy import create_engine + from config import DATABASE_URI + engine = create_engine(DATABASE_URI) + Base.metadata.drop_all(engine) + Base.metadata.create_all(engine) + + from db import session + + card_filenames = ['card1.json', 'card2.json'] + for idx, card_filename in enumerate(card_filenames): + with open('examples/%s' % card_filename) as data_file: + data = json.load(data_file) + for x in range(20): + card = Card(**data) + card.cardId = idx * 20 + x + session.add(card) + session.commit() + + +if __name__ == '__main__': + create_mock_database() diff --git a/server/requirements.txt b/server/requirements.txt new file mode 100644 index 00000000..2bd5a309 --- /dev/null +++ b/server/requirements.txt @@ -0,0 +1,12 @@ +aniso8601==1.3.0 +click==6.7 +Flask==0.12.2 +Flask-RESTful==0.3.6 +itsdangerous==0.24 +Jinja2==2.10 +MarkupSafe==1.0 +python-dateutil==2.6.1 +pytz==2017.3 +six==1.11.0 +SQLAlchemy==1.1.15 +Werkzeug==0.13 diff --git a/server/resources.py b/server/resources.py new file mode 100755 index 00000000..d8204fa0 --- /dev/null +++ b/server/resources.py @@ -0,0 +1,50 @@ +#! .env/bin/python + +from models import Card +from db import session + +from flask_restful import reqparse +from flask_restful import abort +from flask_restful import Resource +from flask_restful import fields +from flask_restful import marshal_with + +card_fields = { + 'cardId': fields.String, + 'name': fields.String, + 'cardSet': fields.String, + 'type': fields.String, + 'rarity': fields.String, + 'cost': fields.Integer, + 'attack': fields.Integer, + 'health': fields.Integer, + 'text': fields.String, + 'flavor': fields.String, + 'artist': fields.String, + 'collectible': fields.Boolean, + 'elite': fields.Boolean, + 'playerClass': fields.String, + 'multiClassGroup': fields.String, + 'howToGet': fields.String, + 'howToGetGold': fields.String, + 'img': fields.String, + 'imgGold': fields.String, + 'locale': fields.String, +} + +parser = reqparse.RequestParser() +parser.add_argument('card', type=str) + +class CardResource(Resource): + @marshal_with(card_fields) + def get(self, cardId): + card = session.query(Card).filter(Card.cardId == cardId).first() + if not card: + abort(404, message="Card {} doesn't exist".format(cardId)) + return card + +class CardListResource(Resource): + @marshal_with(card_fields) + def get(self): + cards = session.query(Card).all() + return cards From 270e69d5330f6c7b34deb98c6086319913248afc Mon Sep 17 00:00:00 2001 From: Sumeru Chatterjee Date: Mon, 18 Dec 2017 18:05:41 +0100 Subject: [PATCH 2/2] Added comment --- client/CoolCards/CoolCardsAPI/CoolCardAPIRequest.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/CoolCards/CoolCardsAPI/CoolCardAPIRequest.swift b/client/CoolCards/CoolCardsAPI/CoolCardAPIRequest.swift index 644fcf89..56ae45e7 100644 --- a/client/CoolCards/CoolCardsAPI/CoolCardAPIRequest.swift +++ b/client/CoolCards/CoolCardsAPI/CoolCardAPIRequest.swift @@ -17,6 +17,8 @@ enum CoolCardsAPIRequest { extension CoolCardsAPIRequest: TargetType { var baseURL: URL { + // The server is running on google app engine in a docker container and the code is also in the repository + return URL(string: "http://35.205.213.172:5000")! }