├── .gitignore ├── AmazonS3Upload.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── AmazonS3Upload.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── AmazonS3Upload ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── test.imageset │ │ ├── Contents.json │ │ └── test.jpg ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── ViewController.swift ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── AWSCore │ ├── AWSCore │ │ ├── AWSCore.h │ │ ├── Authentication │ │ │ ├── AWSCredentialsProvider.h │ │ │ ├── AWSCredentialsProvider.m │ │ │ ├── AWSIdentityProvider.h │ │ │ ├── AWSIdentityProvider.m │ │ │ ├── AWSSignature.h │ │ │ └── AWSSignature.m │ │ ├── Bolts │ │ │ ├── AWSBolts.h │ │ │ ├── AWSBolts.m │ │ │ ├── AWSCancellationToken.h │ │ │ ├── AWSCancellationToken.m │ │ │ ├── AWSCancellationTokenRegistration.h │ │ │ ├── AWSCancellationTokenRegistration.m │ │ │ ├── AWSCancellationTokenSource.h │ │ │ ├── AWSCancellationTokenSource.m │ │ │ ├── AWSExecutor.h │ │ │ ├── AWSExecutor.m │ │ │ ├── AWSGeneric.h │ │ │ ├── AWSTask.h │ │ │ ├── AWSTask.m │ │ │ ├── AWSTaskCompletionSource.h │ │ │ └── AWSTaskCompletionSource.m │ │ ├── CognitoIdentity │ │ │ ├── AWSCognitoIdentity+Fabric.h │ │ │ ├── AWSCognitoIdentity+Fabric.m │ │ │ ├── AWSCognitoIdentity.h │ │ │ ├── AWSCognitoIdentityModel.h │ │ │ ├── AWSCognitoIdentityModel.m │ │ │ ├── AWSCognitoIdentityResources.h │ │ │ ├── AWSCognitoIdentityResources.m │ │ │ ├── AWSCognitoIdentityService.h │ │ │ └── AWSCognitoIdentityService.m │ │ ├── FMDB │ │ │ ├── AWSFMDB.h │ │ │ ├── AWSFMDatabase+Private.h │ │ │ ├── AWSFMDatabase.h │ │ │ ├── AWSFMDatabase.m │ │ │ ├── AWSFMDatabaseAdditions.h │ │ │ ├── AWSFMDatabaseAdditions.m │ │ │ ├── AWSFMDatabasePool.h │ │ │ ├── AWSFMDatabasePool.m │ │ │ ├── AWSFMDatabaseQueue.h │ │ │ ├── AWSFMDatabaseQueue.m │ │ │ ├── AWSFMResultSet.h │ │ │ └── AWSFMResultSet.m │ │ ├── Fabric │ │ │ ├── FABAttributes.h │ │ │ ├── FABKitProtocol.h │ │ │ ├── Fabric+FABKits.h │ │ │ └── Fabric.h │ │ ├── GZIP │ │ │ ├── AWSGZIP.h │ │ │ └── AWSGZIP.m │ │ ├── KSReachability │ │ │ ├── AWSKSReachability.h │ │ │ └── AWSKSReachability.m │ │ ├── Logging │ │ │ ├── AWSCocoaLumberjack.h │ │ │ ├── AWSDDASLLogCapture.h │ │ │ ├── AWSDDASLLogCapture.m │ │ │ ├── AWSDDASLLogger.h │ │ │ ├── AWSDDASLLogger.m │ │ │ ├── AWSDDAbstractDatabaseLogger.h │ │ │ ├── AWSDDAbstractDatabaseLogger.m │ │ │ ├── AWSDDAssertMacros.h │ │ │ ├── AWSDDFileLogger.h │ │ │ ├── AWSDDFileLogger.m │ │ │ ├── AWSDDLegacyMacros.h │ │ │ ├── AWSDDLog+LOGV.h │ │ │ ├── AWSDDLog.h │ │ │ ├── AWSDDLog.m │ │ │ ├── AWSDDLogMacros.h │ │ │ ├── AWSDDOSLogger.h │ │ │ ├── AWSDDOSLogger.m │ │ │ ├── AWSDDTTYLogger.h │ │ │ ├── AWSDDTTYLogger.m │ │ │ └── Extensions │ │ │ │ ├── AWSDDContextFilterLogFormatter.h │ │ │ │ ├── AWSDDContextFilterLogFormatter.m │ │ │ │ ├── AWSDDDispatchQueueLogFormatter.h │ │ │ │ ├── AWSDDDispatchQueueLogFormatter.m │ │ │ │ ├── AWSDDMultiFormatter.h │ │ │ │ └── AWSDDMultiFormatter.m │ │ ├── Mantle │ │ │ ├── AWSMTLJSONAdapter.h │ │ │ ├── AWSMTLJSONAdapter.m │ │ │ ├── AWSMTLManagedObjectAdapter.h │ │ │ ├── AWSMTLManagedObjectAdapter.m │ │ │ ├── AWSMTLModel+NSCoding.h │ │ │ ├── AWSMTLModel+NSCoding.m │ │ │ ├── AWSMTLModel.h │ │ │ ├── AWSMTLModel.m │ │ │ ├── AWSMTLReflection.h │ │ │ ├── AWSMTLReflection.m │ │ │ ├── AWSMTLValueTransformer.h │ │ │ ├── AWSMTLValueTransformer.m │ │ │ ├── AWSMantle.h │ │ │ ├── NSArray+AWSMTLManipulationAdditions.h │ │ │ ├── NSArray+AWSMTLManipulationAdditions.m │ │ │ ├── NSDictionary+AWSMTLManipulationAdditions.h │ │ │ ├── NSDictionary+AWSMTLManipulationAdditions.m │ │ │ ├── NSError+AWSMTLModelException.h │ │ │ ├── NSError+AWSMTLModelException.m │ │ │ ├── NSObject+AWSMTLComparisonAdditions.h │ │ │ ├── NSObject+AWSMTLComparisonAdditions.m │ │ │ ├── NSValueTransformer+AWSMTLInversionAdditions.h │ │ │ ├── NSValueTransformer+AWSMTLInversionAdditions.m │ │ │ ├── NSValueTransformer+AWSMTLPredefinedTransformerAdditions.h │ │ │ ├── NSValueTransformer+AWSMTLPredefinedTransformerAdditions.m │ │ │ └── extobjc │ │ │ │ ├── AWSEXTKeyPathCoding.h │ │ │ │ ├── AWSEXTRuntimeExtensions.h │ │ │ │ ├── AWSEXTRuntimeExtensions.m │ │ │ │ ├── AWSEXTScope.h │ │ │ │ ├── AWSEXTScope.m │ │ │ │ └── AWSmetamacros.h │ │ ├── Networking │ │ │ ├── AWSNetworking.h │ │ │ ├── AWSNetworking.m │ │ │ ├── AWSURLSessionManager.h │ │ │ └── AWSURLSessionManager.m │ │ ├── STS │ │ │ ├── AWSSTS.h │ │ │ ├── AWSSTSModel.h │ │ │ ├── AWSSTSModel.m │ │ │ ├── AWSSTSResources.h │ │ │ ├── AWSSTSResources.m │ │ │ ├── AWSSTSService.h │ │ │ └── AWSSTSService.m │ │ ├── Serialization │ │ │ ├── AWSSerialization.h │ │ │ ├── AWSSerialization.m │ │ │ ├── AWSURLRequestRetryHandler.h │ │ │ ├── AWSURLRequestRetryHandler.m │ │ │ ├── AWSURLRequestSerialization.h │ │ │ ├── AWSURLRequestSerialization.m │ │ │ ├── AWSURLResponseSerialization.h │ │ │ ├── AWSURLResponseSerialization.m │ │ │ ├── AWSValidation.h │ │ │ └── AWSValidation.m │ │ ├── Service │ │ │ ├── AWSClientContext.h │ │ │ ├── AWSClientContext.m │ │ │ ├── AWSInfo.h │ │ │ ├── AWSInfo.m │ │ │ ├── AWSService.h │ │ │ ├── AWSService.m │ │ │ └── AWSServiceEnum.h │ │ ├── TMCache │ │ │ ├── AWSTMCache.h │ │ │ ├── AWSTMCache.m │ │ │ ├── AWSTMCacheBackgroundTaskManager.h │ │ │ ├── AWSTMDiskCache.h │ │ │ ├── AWSTMDiskCache.m │ │ │ ├── AWSTMMemoryCache.h │ │ │ └── AWSTMMemoryCache.m │ │ ├── UICKeyChainStore │ │ │ ├── AWSUICKeyChainStore.h │ │ │ └── AWSUICKeyChainStore.m │ │ ├── Utility │ │ │ ├── AWSCategory.h │ │ │ ├── AWSCategory.m │ │ │ ├── AWSLogging.h │ │ │ ├── AWSLogging.m │ │ │ ├── AWSModel.h │ │ │ ├── AWSModel.m │ │ │ ├── AWSSynchronizedMutableDictionary.h │ │ │ └── AWSSynchronizedMutableDictionary.m │ │ ├── XMLDictionary │ │ │ ├── AWSXMLDictionary.h │ │ │ └── AWSXMLDictionary.m │ │ └── XMLWriter │ │ │ ├── AWSXMLWriter.h │ │ │ └── AWSXMLWriter.m │ ├── LICENSE │ ├── LICENSE.AMAZON │ ├── LICENSE.APACHE │ └── README.md ├── AWSS3 │ ├── AWSS3 │ │ ├── AWSS3.h │ │ ├── AWSS3Model.h │ │ ├── AWSS3Model.m │ │ ├── AWSS3PreSignedURL.h │ │ ├── AWSS3PreSignedURL.m │ │ ├── AWSS3RequestRetryHandler.h │ │ ├── AWSS3RequestRetryHandler.m │ │ ├── AWSS3Resources.h │ │ ├── AWSS3Resources.m │ │ ├── AWSS3Serializer.h │ │ ├── AWSS3Serializer.m │ │ ├── AWSS3Service.h │ │ ├── AWSS3Service.m │ │ ├── AWSS3TransferManager.h │ │ ├── AWSS3TransferManager.m │ │ ├── AWSS3TransferUtility.h │ │ └── AWSS3TransferUtility.m │ ├── LICENSE │ ├── LICENSE.AMAZON │ ├── LICENSE.APACHE │ └── README.md ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj └── Target Support Files │ ├── AWSCore │ ├── AWSCore-dummy.m │ ├── AWSCore-prefix.pch │ ├── AWSCore-umbrella.h │ ├── AWSCore.modulemap │ ├── AWSCore.xcconfig │ └── Info.plist │ ├── AWSS3 │ ├── AWSS3-dummy.m │ ├── AWSS3-prefix.pch │ ├── AWSS3-umbrella.h │ ├── AWSS3.modulemap │ ├── AWSS3.xcconfig │ └── Info.plist │ └── Pods-AmazonS3Upload │ ├── Info.plist │ ├── Pods-AmazonS3Upload-acknowledgements.markdown │ ├── Pods-AmazonS3Upload-acknowledgements.plist │ ├── Pods-AmazonS3Upload-dummy.m │ ├── Pods-AmazonS3Upload-frameworks.sh │ ├── Pods-AmazonS3Upload-resources.sh │ ├── Pods-AmazonS3Upload-umbrella.h │ ├── Pods-AmazonS3Upload.debug.xcconfig │ ├── Pods-AmazonS3Upload.modulemap │ └── Pods-AmazonS3Upload.release.xcconfig ├── README.md └── img └── img1.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /AmazonS3Upload.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AmazonS3Upload.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /AmazonS3Upload.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AmazonS3Upload/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // AmazonS3Upload 4 | // 5 | // Created by Maxim on 12/18/16. 6 | // Copyright © 2016 maximbilan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /AmazonS3Upload/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /AmazonS3Upload/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /AmazonS3Upload/Assets.xcassets/test.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "test.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /AmazonS3Upload/Assets.xcassets/test.imageset/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximbilan/Swift-Amazon-S3-Uploading-Tutorial/b0401281f206444ad36b2566894f6cfa2d7e761e/AmazonS3Upload/Assets.xcassets/test.imageset/test.jpg -------------------------------------------------------------------------------- /AmazonS3Upload/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /AmazonS3Upload/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /AmazonS3Upload/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /AmazonS3Upload/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // AmazonS3Upload 4 | // 5 | // Created by Maxim on 12/18/16. 6 | // Copyright © 2016 maximbilan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AWSS3 11 | import AWSCore 12 | 13 | class ViewController: UIViewController { 14 | 15 | @IBOutlet weak var uploadButton: UIButton! 16 | @IBOutlet weak var activityIndicator: UIActivityIndicatorView! 17 | 18 | override func viewDidLoad() { 19 | super.viewDidLoad() 20 | } 21 | 22 | @IBAction func uploadButtonAction(_ sender: UIButton) { 23 | uploadButton.isHidden = true 24 | activityIndicator.startAnimating() 25 | 26 | let accessKey = "PLEASE_ENTER_YOUR_AMAZON_S3_ACCESS_KEY" 27 | let secretKey = "PLEASE_ENTER_YOUR_AMAZON_S3_SECRET_KEY" 28 | 29 | let credentialsProvider = AWSStaticCredentialsProvider(accessKey: accessKey, secretKey: secretKey) 30 | let configuration = AWSServiceConfiguration(region:AWSRegionType.USEast1, credentialsProvider:credentialsProvider) 31 | 32 | AWSServiceManager.default().defaultServiceConfiguration = configuration 33 | 34 | let S3BucketName = "BUCKET_NAME" 35 | let remoteName = "test.jpg" 36 | let fileURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(remoteName) 37 | let image = UIImage(named: "test") 38 | let data = image!.jpegData(compressionQuality: 0.9) 39 | do { 40 | try data?.write(to: fileURL) 41 | } 42 | catch {} 43 | 44 | let uploadRequest = AWSS3TransferManagerUploadRequest()! 45 | uploadRequest.body = fileURL 46 | uploadRequest.key = remoteName 47 | uploadRequest.bucket = S3BucketName 48 | uploadRequest.contentType = "image/jpeg" 49 | uploadRequest.acl = .publicRead 50 | 51 | let transferManager = AWSS3TransferManager.default() 52 | 53 | transferManager.upload(uploadRequest).continueWith { [weak self] (task) -> Any? in 54 | DispatchQueue.main.async { 55 | self?.uploadButton.isHidden = false 56 | self?.activityIndicator.stopAnimating() 57 | } 58 | 59 | if let error = task.error { 60 | print("Upload failed with error: (\(error.localizedDescription))") 61 | } 62 | 63 | if task.result != nil { 64 | let url = AWSS3.default().configuration.endpoint.url 65 | let publicURL = url?.appendingPathComponent(uploadRequest.bucket!).appendingPathComponent(uploadRequest.key!) 66 | if let absoluteString = publicURL?.absoluteString { 67 | print("Uploaded to:\(absoluteString)") 68 | } 69 | } 70 | 71 | return nil 72 | } 73 | } 74 | 75 | } 76 | 77 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Maxim Bilan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '8.0' 2 | inhibit_all_warnings! 3 | use_frameworks! 4 | 5 | target 'AmazonS3Upload' do 6 | 7 | pod 'AWSS3' 8 | 9 | end 10 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AWSCore (2.6.1) 3 | - AWSS3 (2.6.1): 4 | - AWSCore (= 2.6.1) 5 | 6 | DEPENDENCIES: 7 | - AWSS3 8 | 9 | SPEC CHECKSUMS: 10 | AWSCore: e7d37fa0715def975acf1b0d75556576780088b8 11 | AWSS3: 2e18ede28199a5530955dc1a65434da43dcc4d2c 12 | 13 | PODFILE CHECKSUM: 9994b0fa7d0b4e530aec491c80c2d7fc96f0a0c9 14 | 15 | COCOAPODS: 1.3.1 16 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/AWSCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | //! Project version number for AWSCore. 19 | FOUNDATION_EXPORT double AWSCoreVersionNumber; 20 | 21 | //! Project version string for AWSCore. 22 | FOUNDATION_EXPORT const unsigned char AWSCoreVersionString[]; 23 | 24 | #import "AWSCocoaLumberjack.h" 25 | 26 | #import "AWSServiceEnum.h" 27 | #import "AWSService.h" 28 | #import "AWSCredentialsProvider.h" 29 | #import "AWSIdentityProvider.h" 30 | #import "AWSModel.h" 31 | #import "AWSNetworking.h" 32 | #import "AWSCategory.h" 33 | #import "AWSLogging.h" 34 | #import "AWSClientContext.h" 35 | #import "AWSSynchronizedMutableDictionary.h" 36 | #import "AWSSerialization.h" 37 | #import "AWSURLRequestSerialization.h" 38 | #import "AWSURLResponseSerialization.h" 39 | #import "AWSURLSessionManager.h" 40 | #import "AWSSignature.h" 41 | #import "AWSURLRequestRetryHandler.h" 42 | #import "AWSValidation.h" 43 | #import "AWSInfo.h" 44 | 45 | #import "AWSBolts.h" 46 | #import "AWSGZIP.h" 47 | #import "AWSFMDB.h" 48 | #import "AWSKSReachability.h" 49 | #import "AWSTMCache.h" 50 | #import "AWSUICKeyChainStore.h" 51 | 52 | 53 | #import "AWSSTS.h" 54 | #import "AWSCognitoIdentity.h" 55 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Authentication/AWSSignature.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | #import "AWSNetworking.h" 18 | 19 | FOUNDATION_EXPORT NSString *const AWSSignatureV4Algorithm; 20 | FOUNDATION_EXPORT NSString *const AWSSignatureV4Terminator; 21 | 22 | @class AWSEndpoint; 23 | 24 | @protocol AWSCredentialsProvider; 25 | 26 | @interface AWSSignatureSignerUtility : NSObject 27 | 28 | + (NSData *)sha256HMacWithData:(NSData *)data withKey:(NSData *)key; 29 | + (NSString *)hashString:(NSString *)stringToHash; 30 | + (NSData *)hash:(NSData *)dataToHash; 31 | + (NSString *)hexEncode:(NSString *)string; 32 | + (NSString *)HMACSign:(NSData *)data withKey:(NSString *)key usingAlgorithm:(uint32_t)algorithm; 33 | 34 | @end 35 | 36 | @interface AWSSignatureV4Signer : NSObject 37 | 38 | @property (nonatomic, strong, readonly) id credentialsProvider; 39 | 40 | - (instancetype)initWithCredentialsProvider:(id)credentialsProvider 41 | endpoint:(AWSEndpoint *)endpoint; 42 | 43 | + (AWSTask *)generateQueryStringForSignatureV4WithCredentialProvider:(id)credentialsProvider 44 | httpMethod:(AWSHTTPMethod)httpMethod 45 | expireDuration:(int32_t)expireDuration 46 | endpoint:(AWSEndpoint *)endpoint 47 | keyPath:(NSString *)keyPath 48 | requestHeaders:(NSDictionary *)requestHeaders 49 | requestParameters:(NSDictionary *)requestParameters 50 | signBody:(BOOL)signBody; 51 | 52 | + (NSString *)getCanonicalizedRequest:(NSString *)method 53 | path:(NSString *)path 54 | query:(NSString *)query 55 | headers:(NSDictionary *)headers 56 | contentSha256:(NSString *)contentSha256; 57 | 58 | + (NSData *)getV4DerivedKey:(NSString *)secret 59 | date:(NSString *)dateStamp 60 | region:(NSString *)regionName 61 | service:(NSString *)serviceName; 62 | 63 | + (NSString *)getSignedHeadersString:(NSDictionary *)headers; 64 | 65 | @end 66 | 67 | @interface AWSSignatureV2Signer : NSObject 68 | 69 | @property (nonatomic, strong, readonly) id credentialsProvider; 70 | 71 | + (instancetype)signerWithCredentialsProvider:(id)credentialsProvider 72 | endpoint:(AWSEndpoint *)endpoint; 73 | 74 | - (instancetype)initWithCredentialsProvider:(id)credentialsProvider 75 | endpoint:(AWSEndpoint *)endpoint; 76 | 77 | @end 78 | 79 | /** 80 | * A subclass of NSInputStream that wraps an input stream and adds 81 | * signature of chunk data. 82 | **/ 83 | @interface AWSS3ChunkedEncodingInputStream : NSInputStream 84 | 85 | @property (atomic, assign) int64_t totalLengthOfChunkSignatureSent; 86 | /** 87 | * Initialize the input stream with date, scope, signing key and signature 88 | * of request headers. 89 | **/ 90 | - (instancetype)initWithInputStream:(NSInputStream *)stream 91 | date:(NSDate *)date 92 | scope:(NSString *)scope 93 | kSigning:(NSData *)kSigning 94 | headerSignature:(NSString *)headerSignature; 95 | 96 | /** 97 | * Computes new content length after data being chunked encoded. 98 | **/ 99 | + (NSUInteger)computeContentLengthForChunkedData:(NSUInteger)dataLength; 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSBolts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import "AWSCancellationToken.h" 12 | #import "AWSCancellationTokenRegistration.h" 13 | #import "AWSCancellationTokenSource.h" 14 | #import "AWSExecutor.h" 15 | #import "AWSGeneric.h" 16 | #import "AWSTask.h" 17 | #import "AWSTaskCompletionSource.h" 18 | 19 | 20 | NS_ASSUME_NONNULL_BEGIN 21 | 22 | /** 23 | A string containing the version of the Bolts Framework used by the current application. 24 | */ 25 | extern NSString *const AWSBoltsFrameworkVersionString; 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSBolts.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import "AWSBolts.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | NSString *const AWSBoltsFrameworkVersionString = @"1.8.4"; 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSCancellationToken.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | 13 | #import "AWSCancellationTokenRegistration.h" 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | /*! 18 | A block that will be called when a token is cancelled. 19 | */ 20 | typedef void(^AWSCancellationBlock)(); 21 | 22 | /*! 23 | The consumer view of a CancellationToken. 24 | Propagates notification that operations should be canceled. 25 | A AWSCancellationToken has methods to inspect whether the token has been cancelled. 26 | */ 27 | @interface AWSCancellationToken : NSObject 28 | 29 | /*! 30 | Whether cancellation has been requested for this token source. 31 | */ 32 | @property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested; 33 | 34 | /*! 35 | Register a block to be notified when the token is cancelled. 36 | If the token is already cancelled the delegate will be notified immediately. 37 | */ 38 | - (AWSCancellationTokenRegistration *)registerCancellationObserverWithBlock:(AWSCancellationBlock)block; 39 | 40 | @end 41 | 42 | NS_ASSUME_NONNULL_END 43 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSCancellationToken.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import "AWSCancellationToken.h" 12 | #import "AWSCancellationTokenRegistration.h" 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface AWSCancellationToken () 17 | 18 | @property (nullable, nonatomic, strong) NSMutableArray *registrations; 19 | @property (nonatomic, strong) NSObject *lock; 20 | @property (nonatomic) BOOL disposed; 21 | 22 | @end 23 | 24 | @interface AWSCancellationTokenRegistration (AWSCancellationToken) 25 | 26 | + (instancetype)registrationWithToken:(AWSCancellationToken *)token delegate:(AWSCancellationBlock)delegate; 27 | 28 | - (void)notifyDelegate; 29 | 30 | @end 31 | 32 | @implementation AWSCancellationToken 33 | 34 | @synthesize cancellationRequested = _cancellationRequested; 35 | 36 | #pragma mark - Initializer 37 | 38 | - (instancetype)init { 39 | self = [super init]; 40 | if (!self) return self; 41 | 42 | _registrations = [NSMutableArray array]; 43 | _lock = [NSObject new]; 44 | 45 | return self; 46 | } 47 | 48 | #pragma mark - Custom Setters/Getters 49 | 50 | - (BOOL)isCancellationRequested { 51 | @synchronized(self.lock) { 52 | [self throwIfDisposed]; 53 | return _cancellationRequested; 54 | } 55 | } 56 | 57 | - (void)cancel { 58 | NSArray *registrations; 59 | @synchronized(self.lock) { 60 | [self throwIfDisposed]; 61 | if (_cancellationRequested) { 62 | return; 63 | } 64 | [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(cancelPrivate) object:nil]; 65 | _cancellationRequested = YES; 66 | registrations = [self.registrations copy]; 67 | } 68 | 69 | [self notifyCancellation:registrations]; 70 | } 71 | 72 | - (void)notifyCancellation:(NSArray *)registrations { 73 | for (AWSCancellationTokenRegistration *registration in registrations) { 74 | [registration notifyDelegate]; 75 | } 76 | } 77 | 78 | - (AWSCancellationTokenRegistration *)registerCancellationObserverWithBlock:(AWSCancellationBlock)block { 79 | @synchronized(self.lock) { 80 | AWSCancellationTokenRegistration *registration = [AWSCancellationTokenRegistration registrationWithToken:self delegate:[block copy]]; 81 | [self.registrations addObject:registration]; 82 | 83 | return registration; 84 | } 85 | } 86 | 87 | - (void)unregisterRegistration:(AWSCancellationTokenRegistration *)registration { 88 | @synchronized(self.lock) { 89 | [self throwIfDisposed]; 90 | [self.registrations removeObject:registration]; 91 | } 92 | } 93 | 94 | // Delay on a non-public method to prevent interference with a user calling performSelector or 95 | // cancelPreviousPerformRequestsWithTarget on the public method 96 | - (void)cancelPrivate { 97 | [self cancel]; 98 | } 99 | 100 | - (void)cancelAfterDelay:(int)millis { 101 | [self throwIfDisposed]; 102 | if (millis < -1) { 103 | [NSException raise:NSInvalidArgumentException format:@"Delay must be >= -1"]; 104 | } 105 | 106 | if (millis == 0) { 107 | [self cancel]; 108 | return; 109 | } 110 | 111 | @synchronized(self.lock) { 112 | [self throwIfDisposed]; 113 | [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(cancelPrivate) object:nil]; 114 | if (self.cancellationRequested) { 115 | return; 116 | } 117 | 118 | if (millis != -1) { 119 | double delay = (double)millis / 1000; 120 | [self performSelector:@selector(cancelPrivate) withObject:nil afterDelay:delay]; 121 | } 122 | } 123 | } 124 | 125 | - (void)dispose { 126 | @synchronized(self.lock) { 127 | if (self.disposed) { 128 | return; 129 | } 130 | [self.registrations makeObjectsPerformSelector:@selector(dispose)]; 131 | self.registrations = nil; 132 | self.disposed = YES; 133 | } 134 | } 135 | 136 | - (void)throwIfDisposed { 137 | if (self.disposed) { 138 | [NSException raise:NSInternalInconsistencyException format:@"Object already disposed"]; 139 | } 140 | } 141 | 142 | @end 143 | 144 | NS_ASSUME_NONNULL_END 145 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSCancellationTokenRegistration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | /*! 16 | Represents the registration of a cancellation observer with a cancellation token. 17 | Can be used to unregister the observer at a later time. 18 | */ 19 | @interface AWSCancellationTokenRegistration : NSObject 20 | 21 | /*! 22 | Removes the cancellation observer registered with the token 23 | and releases all resources associated with this registration. 24 | */ 25 | - (void)dispose; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSCancellationTokenRegistration.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import "AWSCancellationTokenRegistration.h" 12 | 13 | #import "AWSCancellationToken.h" 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface AWSCancellationTokenRegistration () 18 | 19 | @property (nonatomic, weak) AWSCancellationToken *token; 20 | @property (nullable, nonatomic, strong) AWSCancellationBlock cancellationObserverBlock; 21 | @property (nonatomic, strong) NSObject *lock; 22 | @property (nonatomic) BOOL disposed; 23 | 24 | @end 25 | 26 | @interface AWSCancellationToken (AWSCancellationTokenRegistration) 27 | 28 | - (void)unregisterRegistration:(AWSCancellationTokenRegistration *)registration; 29 | 30 | @end 31 | 32 | @implementation AWSCancellationTokenRegistration 33 | 34 | + (instancetype)registrationWithToken:(AWSCancellationToken *)token delegate:(AWSCancellationBlock)delegate { 35 | AWSCancellationTokenRegistration *registration = [AWSCancellationTokenRegistration new]; 36 | registration.token = token; 37 | registration.cancellationObserverBlock = delegate; 38 | return registration; 39 | } 40 | 41 | - (instancetype)init { 42 | self = [super init]; 43 | if (!self) return self; 44 | 45 | _lock = [NSObject new]; 46 | 47 | return self; 48 | } 49 | 50 | - (void)dispose { 51 | @synchronized(self.lock) { 52 | if (self.disposed) { 53 | return; 54 | } 55 | self.disposed = YES; 56 | } 57 | 58 | AWSCancellationToken *token = self.token; 59 | if (token != nil) { 60 | [token unregisterRegistration:self]; 61 | self.token = nil; 62 | } 63 | self.cancellationObserverBlock = nil; 64 | } 65 | 66 | - (void)notifyDelegate { 67 | @synchronized(self.lock) { 68 | [self throwIfDisposed]; 69 | self.cancellationObserverBlock(); 70 | } 71 | } 72 | 73 | - (void)throwIfDisposed { 74 | NSAssert(!self.disposed, @"Object already disposed"); 75 | } 76 | 77 | @end 78 | 79 | NS_ASSUME_NONNULL_END 80 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSCancellationTokenSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @class AWSCancellationToken; 16 | 17 | /*! 18 | AWSCancellationTokenSource represents the producer side of a CancellationToken. 19 | Signals to a CancellationToken that it should be canceled. 20 | It is a cancellation token that also has methods 21 | for changing the state of a token by cancelling it. 22 | */ 23 | @interface AWSCancellationTokenSource : NSObject 24 | 25 | /*! 26 | Creates a new cancellation token source. 27 | */ 28 | + (instancetype)cancellationTokenSource; 29 | 30 | /*! 31 | The cancellation token associated with this CancellationTokenSource. 32 | */ 33 | @property (nonatomic, strong, readonly) AWSCancellationToken *token; 34 | 35 | /*! 36 | Whether cancellation has been requested for this token source. 37 | */ 38 | @property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested; 39 | 40 | /*! 41 | Cancels the token if it has not already been cancelled. 42 | */ 43 | - (void)cancel; 44 | 45 | /*! 46 | Schedules a cancel operation on this CancellationTokenSource after the specified number of milliseconds. 47 | @param millis The number of milliseconds to wait before completing the returned task. 48 | If delay is `0` the cancel is executed immediately. If delay is `-1` any scheduled cancellation is stopped. 49 | */ 50 | - (void)cancelAfterDelay:(int)millis; 51 | 52 | /*! 53 | Releases all resources associated with this token source, 54 | including disposing of all registrations. 55 | */ 56 | - (void)dispose; 57 | 58 | @end 59 | 60 | NS_ASSUME_NONNULL_END 61 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSCancellationTokenSource.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import "AWSCancellationTokenSource.h" 12 | 13 | #import "AWSCancellationToken.h" 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface AWSCancellationToken (AWSCancellationTokenSource) 18 | 19 | - (void)cancel; 20 | - (void)cancelAfterDelay:(int)millis; 21 | 22 | - (void)dispose; 23 | - (void)throwIfDisposed; 24 | 25 | @end 26 | 27 | @implementation AWSCancellationTokenSource 28 | 29 | #pragma mark - Initializer 30 | 31 | - (instancetype)init { 32 | self = [super init]; 33 | if (!self) return self; 34 | 35 | _token = [AWSCancellationToken new]; 36 | 37 | return self; 38 | } 39 | 40 | + (instancetype)cancellationTokenSource { 41 | return [AWSCancellationTokenSource new]; 42 | } 43 | 44 | #pragma mark - Custom Setters/Getters 45 | 46 | - (BOOL)isCancellationRequested { 47 | return _token.isCancellationRequested; 48 | } 49 | 50 | - (void)cancel { 51 | [_token cancel]; 52 | } 53 | 54 | - (void)cancelAfterDelay:(int)millis { 55 | [_token cancelAfterDelay:millis]; 56 | } 57 | 58 | - (void)dispose { 59 | [_token dispose]; 60 | } 61 | 62 | @end 63 | 64 | NS_ASSUME_NONNULL_END 65 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSExecutor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | /*! 16 | An object that can run a given block. 17 | */ 18 | @interface AWSExecutor : NSObject 19 | 20 | /*! 21 | Returns a default executor, which runs continuations immediately until the call stack gets too 22 | deep, then dispatches to a new GCD queue. 23 | */ 24 | + (instancetype)defaultExecutor; 25 | 26 | /*! 27 | Returns an executor that runs continuations on the thread where the previous task was completed. 28 | */ 29 | + (instancetype)immediateExecutor; 30 | 31 | /*! 32 | Returns an executor that runs continuations on the main thread. 33 | */ 34 | + (instancetype)mainThreadExecutor; 35 | 36 | /*! 37 | Returns a new executor that uses the given block to execute continuations. 38 | @param block The block to use. 39 | */ 40 | + (instancetype)executorWithBlock:(void(^)(void(^block)()))block; 41 | 42 | /*! 43 | Returns a new executor that runs continuations on the given queue. 44 | @param queue The instance of `dispatch_queue_t` to dispatch all continuations onto. 45 | */ 46 | + (instancetype)executorWithDispatchQueue:(dispatch_queue_t)queue; 47 | 48 | /*! 49 | Returns a new executor that runs continuations on the given queue. 50 | @param queue The instance of `NSOperationQueue` to run all continuations on. 51 | */ 52 | + (instancetype)executorWithOperationQueue:(NSOperationQueue *)queue; 53 | 54 | /*! 55 | Runs the given block using this executor's particular strategy. 56 | @param block The block to execute. 57 | */ 58 | - (void)execute:(void(^)())block; 59 | 60 | @end 61 | 62 | NS_ASSUME_NONNULL_END 63 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSExecutor.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import "AWSExecutor.h" 12 | 13 | #import 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | /*! 18 | Get the remaining stack-size of the current thread. 19 | 20 | @param totalSize The total stack size of the current thread. 21 | 22 | @return The remaining size, in bytes, available to the current thread. 23 | 24 | @note This function cannot be inlined, as otherwise the internal implementation could fail to report the proper 25 | remaining stack space. 26 | */ 27 | __attribute__((noinline)) static size_t remaining_stack_size(size_t *restrict totalSize) { 28 | pthread_t currentThread = pthread_self(); 29 | 30 | // NOTE: We must store stack pointers as uint8_t so that the pointer math is well-defined 31 | uint8_t *endStack = pthread_get_stackaddr_np(currentThread); 32 | *totalSize = pthread_get_stacksize_np(currentThread); 33 | 34 | // NOTE: If the function is inlined, this value could be incorrect 35 | uint8_t *frameAddr = __builtin_frame_address(0); 36 | 37 | return (*totalSize) - (size_t)(endStack - frameAddr); 38 | } 39 | 40 | @interface AWSExecutor () 41 | 42 | @property (nonatomic, copy) void(^block)(void(^block)()); 43 | 44 | @end 45 | 46 | @implementation AWSExecutor 47 | 48 | #pragma mark - Executor methods 49 | 50 | + (instancetype)defaultExecutor { 51 | static AWSExecutor *defaultExecutor = NULL; 52 | static dispatch_once_t onceToken; 53 | dispatch_once(&onceToken, ^{ 54 | defaultExecutor = [self executorWithBlock:^void(void(^block)()) { 55 | // We prefer to run everything possible immediately, so that there is callstack information 56 | // when debugging. However, we don't want the stack to get too deep, so if the remaining stack space 57 | // is less than 10% of the total space, we dispatch to another GCD queue. 58 | size_t totalStackSize = 0; 59 | size_t remainingStackSize = remaining_stack_size(&totalStackSize); 60 | 61 | if (remainingStackSize < (totalStackSize / 10)) { 62 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block); 63 | } else { 64 | @autoreleasepool { 65 | block(); 66 | } 67 | } 68 | }]; 69 | }); 70 | return defaultExecutor; 71 | } 72 | 73 | + (instancetype)immediateExecutor { 74 | static AWSExecutor *immediateExecutor = NULL; 75 | static dispatch_once_t onceToken; 76 | dispatch_once(&onceToken, ^{ 77 | immediateExecutor = [self executorWithBlock:^void(void(^block)()) { 78 | block(); 79 | }]; 80 | }); 81 | return immediateExecutor; 82 | } 83 | 84 | + (instancetype)mainThreadExecutor { 85 | static AWSExecutor *mainThreadExecutor = NULL; 86 | static dispatch_once_t onceToken; 87 | dispatch_once(&onceToken, ^{ 88 | mainThreadExecutor = [self executorWithBlock:^void(void(^block)()) { 89 | if (![NSThread isMainThread]) { 90 | dispatch_async(dispatch_get_main_queue(), block); 91 | } else { 92 | @autoreleasepool { 93 | block(); 94 | } 95 | } 96 | }]; 97 | }); 98 | return mainThreadExecutor; 99 | } 100 | 101 | + (instancetype)executorWithBlock:(void(^)(void(^block)()))block { 102 | return [[self alloc] initWithBlock:block]; 103 | } 104 | 105 | + (instancetype)executorWithDispatchQueue:(dispatch_queue_t)queue { 106 | return [self executorWithBlock:^void(void(^block)()) { 107 | dispatch_async(queue, block); 108 | }]; 109 | } 110 | 111 | + (instancetype)executorWithOperationQueue:(NSOperationQueue *)queue { 112 | return [self executorWithBlock:^void(void(^block)()) { 113 | [queue addOperation:[NSBlockOperation blockOperationWithBlock:block]]; 114 | }]; 115 | } 116 | 117 | #pragma mark - Initializer 118 | 119 | - (instancetype)initWithBlock:(void(^)(void(^block)()))block { 120 | self = [super init]; 121 | if (!self) return self; 122 | 123 | _block = block; 124 | 125 | return self; 126 | } 127 | 128 | #pragma mark - Execution 129 | 130 | - (void)execute:(void(^)())block { 131 | self.block(block); 132 | } 133 | 134 | @end 135 | 136 | NS_ASSUME_NONNULL_END 137 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSGeneric.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | 13 | #pragma once 14 | 15 | /** 16 | This exists to use along with `AWSTask` and `AWSTaskCompletionSource`. 17 | 18 | Instead of returning a `AWSTask` with no generic type, or a generic type of 'NSNull' 19 | when there is no usable result from a task, we use the type 'AWSVoid', which will always have a value of `nil`. 20 | 21 | This allows you to provide a more enforced API contract to the caller, 22 | as sending any message to `AWSVoid` will result in a compile time error. 23 | */ 24 | @class _AWSVoid_Nonexistant; 25 | typedef _AWSVoid_Nonexistant *AWSVoid; 26 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSTaskCompletionSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @class AWSTask<__covariant ResultType>; 16 | 17 | /*! 18 | A AWSTaskCompletionSource represents the producer side of tasks. 19 | It is a task that also has methods for changing the state of the 20 | task by settings its completion values. 21 | */ 22 | @interface AWSTaskCompletionSource<__covariant ResultType> : NSObject 23 | 24 | /*! 25 | Creates a new unfinished task. 26 | */ 27 | + (instancetype)taskCompletionSource; 28 | 29 | /*! 30 | The task associated with this TaskCompletionSource. 31 | */ 32 | @property (nonatomic, strong, readonly) AWSTask *task; 33 | 34 | /*! 35 | Completes the task by setting the result. 36 | Attempting to set this for a completed task will raise an exception. 37 | @param result The result of the task. 38 | */ 39 | - (void)setResult:(nullable ResultType)result NS_SWIFT_NAME(set(result:)); 40 | 41 | /*! 42 | Completes the task by setting the error. 43 | Attempting to set this for a completed task will raise an exception. 44 | @param error The error for the task. 45 | */ 46 | - (void)setError:(NSError *)error NS_SWIFT_NAME(set(error:)); 47 | 48 | /*! 49 | Completes the task by marking it as cancelled. 50 | Attempting to set this for a completed task will raise an exception. 51 | */ 52 | - (void)cancel; 53 | 54 | /*! 55 | Sets the result of the task if it wasn't already completed. 56 | @returns whether the new value was set. 57 | */ 58 | - (BOOL)trySetResult:(nullable ResultType)result NS_SWIFT_NAME(trySet(result:)); 59 | 60 | /*! 61 | Sets the error of the task if it wasn't already completed. 62 | @param error The error for the task. 63 | @returns whether the new value was set. 64 | */ 65 | - (BOOL)trySetError:(NSError *)error NS_SWIFT_NAME(trySet(error:)); 66 | 67 | /*! 68 | Sets the cancellation state of the task if it wasn't already completed. 69 | @returns whether the new value was set. 70 | */ 71 | - (BOOL)trySetCancelled; 72 | 73 | @end 74 | 75 | NS_ASSUME_NONNULL_END 76 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Bolts/AWSTaskCompletionSource.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import "AWSTaskCompletionSource.h" 12 | 13 | #import "AWSTask.h" 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface AWSTask (AWSTaskCompletionSource) 18 | 19 | - (BOOL)trySetResult:(nullable id)result; 20 | - (BOOL)trySetError:(NSError *)error; 21 | - (BOOL)trySetCancelled; 22 | 23 | @end 24 | 25 | @implementation AWSTaskCompletionSource 26 | 27 | #pragma mark - Initializer 28 | 29 | + (instancetype)taskCompletionSource { 30 | return [[self alloc] init]; 31 | } 32 | 33 | - (instancetype)init { 34 | self = [super init]; 35 | if (!self) return self; 36 | 37 | _task = [[AWSTask alloc] init]; 38 | 39 | return self; 40 | } 41 | 42 | #pragma mark - Custom Setters/Getters 43 | 44 | - (void)setResult:(nullable id)result { 45 | if (![self.task trySetResult:result]) { 46 | [NSException raise:NSInternalInconsistencyException 47 | format:@"Cannot set the result on a completed task."]; 48 | } 49 | } 50 | 51 | - (void)setError:(NSError *)error { 52 | if (![self.task trySetError:error]) { 53 | [NSException raise:NSInternalInconsistencyException 54 | format:@"Cannot set the error on a completed task."]; 55 | } 56 | } 57 | 58 | - (void)cancel { 59 | if (![self.task trySetCancelled]) { 60 | [NSException raise:NSInternalInconsistencyException 61 | format:@"Cannot cancel a completed task."]; 62 | } 63 | } 64 | 65 | - (BOOL)trySetResult:(nullable id)result { 66 | return [self.task trySetResult:result]; 67 | } 68 | 69 | - (BOOL)trySetError:(NSError *)error { 70 | return [self.task trySetError:error]; 71 | } 72 | 73 | - (BOOL)trySetCancelled { 74 | return [self.task trySetCancelled]; 75 | } 76 | 77 | @end 78 | 79 | NS_ASSUME_NONNULL_END 80 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/CognitoIdentity/AWSCognitoIdentity+Fabric.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import "AWSCognitoIdentity.h" 17 | #import "FABKitProtocol.h" 18 | #import "Fabric+FABKits.h" 19 | 20 | @interface AWSCognitoIdentity (Fabric) 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/CognitoIdentity/AWSCognitoIdentity+Fabric.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | #import "AWSCognitoIdentity+Fabric.h" 16 | 17 | @implementation AWSCognitoIdentity (Fabric) 18 | 19 | #pragma mark - Fabric 20 | 21 | + (NSString *)bundleIdentifier { 22 | return @"com.amazonaws.sdk.ios.AWSCognitoIdentity"; 23 | } 24 | 25 | + (NSString *)kitDisplayVersion { 26 | return AWSiOSSDKVersion; 27 | } 28 | 29 | + (void)internalInitializeIfNeeded { 30 | // Retrieves the configuration from info.plist. 31 | Class fabricClass = NSClassFromString(@"Fabric"); 32 | if (fabricClass 33 | && [fabricClass respondsToSelector:@selector(configurationDictionaryForKitClass:)]) { 34 | NSDictionary *configurationDictionary = [fabricClass configurationDictionaryForKitClass:[AWSCognitoIdentity class]]; 35 | NSString *defaultRegionTypeString = configurationDictionary[@"AWSDefaultRegionType"]; 36 | AWSRegionType defaultRegionType = [defaultRegionTypeString aws_regionTypeValue]; 37 | NSString *cognitoIdentityRegionTypeString = configurationDictionary[@"AWSCognitoIdentityRegionType"]; 38 | AWSRegionType cognitoIdentityRegionType = [cognitoIdentityRegionTypeString aws_regionTypeValue]; 39 | NSString *cognitoIdentityPoolId = configurationDictionary[@"AWSCognitoIdentityPoolId"]; 40 | 41 | static dispatch_once_t onceToken; 42 | dispatch_once(&onceToken, ^{ 43 | // Performs some basic configuration check. 44 | if (cognitoIdentityPoolId 45 | && defaultRegionType != AWSRegionUnknown 46 | && cognitoIdentityRegionType != AWSRegionUnknown) { 47 | // Sets up the AWS Mobile SDK. 48 | AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:cognitoIdentityRegionType 49 | identityPoolId:cognitoIdentityPoolId]; 50 | AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:defaultRegionType 51 | credentialsProvider:credentialsProvider]; 52 | [configuration addUserAgentProductToken:@"fabric"]; 53 | AWSServiceManager.defaultServiceManager.defaultServiceConfiguration = configuration; 54 | AWSDDLogInfo(@"The default Cognito credentials provider and service configuration were successfully initialized."); 55 | } else { 56 | // The configuration values from info.plist seem invalid. 57 | AWSDDLogWarn(@"Could not find valid 'AWSDefaultRegionType', 'AWSCognitoRegionType', and 'AWSCognitoIdentityPoolId' values in info.plist. Unable to set the default Cognito credentials provider and service configuration. Please follow the instructions on this website and manually set up the AWS Mobile SDK for iOS. http://docs.aws.amazon.com/mobile/sdkforios/developerguide/setup.html"); 58 | } 59 | }); 60 | } else { 61 | AWSDDLogError(@"Fabric is not available."); 62 | } 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/CognitoIdentity/AWSCognitoIdentity.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | 19 | 20 | 21 | #import "AWSCore.h" 22 | #import "AWSCognitoIdentityService.h" 23 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/CognitoIdentity/AWSCognitoIdentityResources.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | @interface AWSCognitoIdentityResources : NSObject 19 | 20 | + (instancetype)sharedInstance; 21 | 22 | - (NSDictionary *)JSONObject; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/FMDB/AWSFMDB.h: -------------------------------------------------------------------------------- 1 | #import "AWSFMDatabase.h" 2 | #import "AWSFMResultSet.h" 3 | #import "AWSFMDatabaseAdditions.h" 4 | #import "AWSFMDatabaseQueue.h" 5 | #import "AWSFMDatabasePool.h" 6 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/FMDB/AWSFMDatabase+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMDatabase+Private.h 3 | // deleteme2 4 | // 5 | // Created by Robert Ryan on 8/2/15. 6 | // Copyright (c) 2015 Robert Ryan. All rights reserved. 7 | // 8 | 9 | #ifndef deleteme2_FMDatabase_Private_h 10 | #define deleteme2_FMDatabase_Private_h 11 | 12 | #import 13 | 14 | @class AWSFMDatabase; 15 | @class AWSFMStatement; 16 | 17 | @interface AWSFMDatabase (Private) 18 | 19 | /** SQLite sqlite3 20 | 21 | @see [`sqlite3`](http://www.sqlite.org/c3ref/sqlite3.html) 22 | */ 23 | 24 | @property (nonatomic, assign, readonly) sqlite3 *db; 25 | 26 | @end 27 | 28 | @interface AWSFMStatement (Private) 29 | 30 | /** SQLite sqlite3_stmt 31 | 32 | @see [`sqlite3_stmt`](http://www.sqlite.org/c3ref/stmt.html) 33 | */ 34 | 35 | @property (nonatomic, assign) sqlite3_stmt *statement; 36 | 37 | @end 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Fabric/FABAttributes.h: -------------------------------------------------------------------------------- 1 | // 2 | // FABAttributes.h 3 | // Fabric 4 | // 5 | // Copyright (C) 2015 Twitter, Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #pragma once 21 | 22 | #define FAB_UNAVAILABLE(x) __attribute__((unavailable(x))) 23 | 24 | #if __has_feature(nullability) 25 | #define fab_nullable nullable 26 | #define fab_nonnull nonnull 27 | #define fab_null_unspecified null_unspecified 28 | #define fab_null_resettable null_resettable 29 | #define __fab_nullable __nullable 30 | #define __fab_nonnull __nonnull 31 | #define __fab_null_unspecified __null_unspecified 32 | #else 33 | #define fab_nullable 34 | #define fab_nonnull 35 | #define fab_null_unspecified 36 | #define fab_null_resettable 37 | #define __fab_nullable 38 | #define __fab_nonnull 39 | #define __fab_null_unspecified 40 | #endif 41 | 42 | #ifndef NS_ASSUME_NONNULL_BEGIN 43 | #define NS_ASSUME_NONNULL_BEGIN 44 | #endif 45 | 46 | #ifndef NS_ASSUME_NONNULL_END 47 | #define NS_ASSUME_NONNULL_END 48 | #endif 49 | 50 | 51 | /** 52 | * The following macros are defined here to provide 53 | * backwards compatability. If you are still using 54 | * them you should migrate to the new versions that 55 | * are defined above. 56 | */ 57 | #define FAB_NONNULL __fab_nonnull 58 | #define FAB_NULLABLE __fab_nullable 59 | #define FAB_START_NONNULL NS_ASSUME_NONNULL_BEGIN 60 | #define FAB_END_NONNULL NS_ASSUME_NONNULL_END 61 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Fabric/FABKitProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // FABKitProtocol.h 3 | // Fabric 4 | // 5 | // Copyright (C) 2015 Twitter, Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | /** 23 | * Protocol that a class in a Fabric Kit must conform to to provide information to Fabric at runtime. 24 | */ 25 | @protocol FABKit 26 | 27 | @required 28 | 29 | /** 30 | * Required. The globally unique identifier of the Kit. 31 | * We encourage the use of reverse-DNS notation. 32 | * Example: @"io.fabric.sdk.ios" 33 | */ 34 | + (NSString *)bundleIdentifier; 35 | 36 | /** 37 | * Required. Must return the current version of the Kit that is being used at runtime. 38 | * We encourage the use of semantic versioning (http://semver.org/), without prefixing the version with a "v". 39 | * This is commonly referred to as the "marketing version". 40 | * Example: @"1.2.3" 41 | */ 42 | + (NSString *)kitDisplayVersion; 43 | 44 | @optional 45 | 46 | /** 47 | * The build version of the kit. Should be monotonically increasing and unique. 48 | * Example: 137 49 | */ 50 | + (NSString *)kitBuildVersion; 51 | 52 | /** 53 | * Perform any necessary initialization. 54 | * This method will be invoked on the Kit when the user calls +[Fabric initializeKits]. 55 | * @note This method being called does not necessarily imply that the developer has started using the Kit yet. 56 | */ 57 | + (void)initializeIfNeeded; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Fabric/Fabric+FABKits.h: -------------------------------------------------------------------------------- 1 | // 2 | // Fabric+FABKits.h 3 | // Fabric 4 | // 5 | // Copyright (C) 2015 Twitter, Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "Fabric.h" 21 | 22 | @protocol FABKit; 23 | // Use this category for methods that kits can call on Fabric. 24 | @interface Fabric (FABKits) 25 | 26 | /** 27 | * Returns a dictionary containing the kit configuration info for the provided kit. 28 | * The configuration information is parsed from the application's Info.plist. This 29 | * method is primarily intended to be used by kits to retrieve their configuration. 30 | * 31 | * @param kitClass The class of the kit whose configuration should be returned. 32 | * It should conform to the FABKit protocol. 33 | * 34 | * @return A dictionary containing kit specific configuration information or nil if none exists. 35 | */ 36 | + (fab_nonnull NSDictionary *)configurationDictionaryForKitClass:(fab_nonnull Class)kitClass; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Fabric/Fabric.h: -------------------------------------------------------------------------------- 1 | // 2 | // Fabric.h 3 | // Fabric 4 | // 5 | // Copyright (C) 2015 Twitter, Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "FABAttributes.h" 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | /** 26 | * Fabric Base. Coordinates configuration and starts all provided kits. 27 | */ 28 | @interface Fabric : NSObject 29 | 30 | /** 31 | * Initialize Fabric and all provided kits. Call this method within your App Delegate's `application:didFinishLaunchingWithOptions:` and provide the kits you wish to use. 32 | * 33 | * For example, in Objective-C: 34 | * 35 | * `[Fabric with:@[[Crashlytics class], [Twitter class], [Digits class], [MoPub class]]];` 36 | * 37 | * Swift: 38 | * 39 | * `Fabric.with([Crashlytics.self(), Twitter.self(), Digits.self(), MoPub.self()])` 40 | * 41 | * Only the first call to this method is honored. Subsequent calls are no-ops. 42 | * 43 | * @param kitClasses An array of kit Class objects 44 | * 45 | * @return Returns the shared Fabric instance. In most cases this can be ignored. 46 | */ 47 | + (instancetype)with:(NSArray *)kitClasses; 48 | 49 | /** 50 | * Returns the Fabric singleton object. 51 | */ 52 | + (instancetype)sharedSDK; 53 | 54 | /** 55 | * This BOOL enables or disables debug logging, such as kit version information. The default value is NO. 56 | */ 57 | @property (nonatomic, assign) BOOL debug; 58 | 59 | /** 60 | * Unavailable. Use `+sharedSDK` to retrieve the shared Fabric instance. 61 | */ 62 | - (id)init FAB_UNAVAILABLE("Use +sharedSDK to retrieve the shared Fabric instance."); 63 | 64 | @end 65 | 66 | NS_ASSUME_NONNULL_END 67 | 68 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/GZIP/AWSGZIP.h: -------------------------------------------------------------------------------- 1 | // 2 | // GZIP.h 3 | // 4 | // Version 1.0.3 5 | // 6 | // Created by Nick Lockwood on 03/06/2012. 7 | // Copyright (C) 2012 Charcoal Design 8 | // 9 | // Distributed under the permissive zlib License 10 | // Get the latest version from here: 11 | // 12 | // https://github.com/nicklockwood/GZIP 13 | // 14 | // This software is provided 'as-is', without any express or implied 15 | // warranty. In no event will the authors be held liable for any damages 16 | // arising from the use of this software. 17 | // 18 | // Permission is granted to anyone to use this software for any purpose, 19 | // including commercial applications, and to alter it and redistribute it 20 | // freely, subject to the following restrictions: 21 | // 22 | // 1. The origin of this software must not be misrepresented; you must not 23 | // claim that you wrote the original software. If you use this software 24 | // in a product, an acknowledgment in the product documentation would be 25 | // appreciated but is not required. 26 | // 27 | // 2. Altered source versions must be plainly marked as such, and must not be 28 | // misrepresented as being the original software. 29 | // 30 | // 3. This notice may not be removed or altered from any source distribution. 31 | // 32 | 33 | 34 | #import 35 | 36 | void awsgzip_loadGZIP(); 37 | 38 | @interface NSData (AWSGZIP) 39 | 40 | - (NSData *)awsgzip_gzippedDataWithCompressionLevel:(float)level; 41 | - (NSData *)awsgzip_gzippedData; 42 | - (NSData *)awsgzip_gunzippedData; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/GZIP/AWSGZIP.m: -------------------------------------------------------------------------------- 1 | // 2 | // GZIP.m 3 | // 4 | // Version 1.0.3 5 | // 6 | // Created by Nick Lockwood on 03/06/2012. 7 | // Copyright (C) 2012 Charcoal Design 8 | // 9 | // Distributed under the permissive zlib License 10 | // Get the latest version from here: 11 | // 12 | // https://github.com/nicklockwood/GZIP 13 | // 14 | // This software is provided 'as-is', without any express or implied 15 | // warranty. In no event will the authors be held liable for any damages 16 | // arising from the use of this software. 17 | // 18 | // Permission is granted to anyone to use this software for any purpose, 19 | // including commercial applications, and to alter it and redistribute it 20 | // freely, subject to the following restrictions: 21 | // 22 | // 1. The origin of this software must not be misrepresented; you must not 23 | // claim that you wrote the original software. If you use this software 24 | // in a product, an acknowledgment in the product documentation would be 25 | // appreciated but is not required. 26 | // 27 | // 2. Altered source versions must be plainly marked as such, and must not be 28 | // misrepresented as being the original software. 29 | // 30 | // 3. This notice may not be removed or altered from any source distribution. 31 | // 32 | 33 | 34 | #import "AWSGZIP.h" 35 | #import 36 | 37 | void awsgzip_loadGZIP(){ 38 | } 39 | 40 | static const NSUInteger ChunkSize = 16384; 41 | 42 | 43 | @implementation NSData (AWSGZIP) 44 | 45 | - (NSData *)awsgzip_gzippedDataWithCompressionLevel:(float)level 46 | { 47 | if ([self length]) 48 | { 49 | z_stream stream; 50 | stream.zalloc = Z_NULL; 51 | stream.zfree = Z_NULL; 52 | stream.opaque = Z_NULL; 53 | stream.avail_in = (uint)[self length]; 54 | stream.next_in = (Bytef *)[self bytes]; 55 | stream.total_out = 0; 56 | stream.avail_out = 0; 57 | 58 | int compression = (level < 0.0f)? Z_DEFAULT_COMPRESSION: (int)(roundf(level * 9)); 59 | if (deflateInit2(&stream, compression, Z_DEFLATED, 31, 8, Z_DEFAULT_STRATEGY) == Z_OK) 60 | { 61 | NSMutableData *data = [NSMutableData dataWithLength:ChunkSize]; 62 | while (stream.avail_out == 0) 63 | { 64 | if (stream.total_out >= [data length]) 65 | { 66 | data.length += ChunkSize; 67 | } 68 | stream.next_out = (uint8_t *)[data mutableBytes] + stream.total_out; 69 | stream.avail_out = (uInt)([data length] - stream.total_out); 70 | deflate(&stream, Z_FINISH); 71 | } 72 | deflateEnd(&stream); 73 | data.length = stream.total_out; 74 | return data; 75 | } 76 | } 77 | return nil; 78 | } 79 | 80 | - (NSData *)awsgzip_gzippedData 81 | { 82 | return [self awsgzip_gzippedDataWithCompressionLevel:-1.0f]; 83 | } 84 | 85 | - (NSData *)awsgzip_gunzippedData 86 | { 87 | if ([self length]) 88 | { 89 | z_stream stream; 90 | stream.zalloc = Z_NULL; 91 | stream.zfree = Z_NULL; 92 | stream.avail_in = (uint)[self length]; 93 | stream.next_in = (Bytef *)[self bytes]; 94 | stream.total_out = 0; 95 | stream.avail_out = 0; 96 | 97 | NSMutableData *data = [NSMutableData dataWithLength:(NSUInteger)([self length] * 1.5)]; 98 | if (inflateInit2(&stream, 47) == Z_OK) 99 | { 100 | int status = Z_OK; 101 | while (status == Z_OK) 102 | { 103 | if (stream.total_out >= [data length]) 104 | { 105 | data.length += [self length] / 2; 106 | } 107 | stream.next_out = (uint8_t *)[data mutableBytes] + stream.total_out; 108 | stream.avail_out = (uInt)([data length] - stream.total_out); 109 | status = inflate (&stream, Z_SYNC_FLUSH); 110 | } 111 | if (inflateEnd(&stream) == Z_OK) 112 | { 113 | if (status == Z_STREAM_END) 114 | { 115 | data.length = stream.total_out; 116 | return data; 117 | } 118 | } 119 | } 120 | } 121 | return nil; 122 | } 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/AWSCocoaLumberjack.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | /** 17 | * Welcome to CocoaLumberjack! 18 | * 19 | * The project page has a wealth of documentation if you have any questions. 20 | * https://github.com/CocoaLumberjack/CocoaLumberjack 21 | * 22 | * If you're new to the project you may wish to read "Getting Started" at: 23 | * Documentation/GettingStarted.md 24 | * 25 | * Otherwise, here is a quick refresher. 26 | * There are three steps to using the macros: 27 | * 28 | * Step 1: 29 | * Import the header in your implementation or prefix file: 30 | * 31 | * #import 32 | * 33 | * Step 2: 34 | * Define your logging level in your implementation file: 35 | * 36 | * // Log levels: off, error, warn, info, verbose 37 | * static const AWSDDLogLevel ddLogLevel = AWSDDLogLevelVerbose; 38 | * 39 | * Step 2 [3rd party frameworks]: 40 | * 41 | * Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel: 42 | * 43 | * // #undef LOG_LEVEL_DEF // Undefine first only if needed 44 | * #define LOG_LEVEL_DEF myLibLogLevel 45 | * 46 | * Define your logging level in your implementation file: 47 | * 48 | * // Log levels: off, error, warn, info, verbose 49 | * static const AWSDDLogLevel myLibLogLevel = AWSDDLogLevelVerbose; 50 | * 51 | * Step 3: 52 | * Replace your NSLog statements with AWSDDLog statements according to the severity of the message. 53 | * 54 | * NSLog(@"Fatal error, no dohickey found!"); -> AWSDDLogError(@"Fatal error, no dohickey found!"); 55 | * 56 | * AWSDDLog works exactly the same as NSLog. 57 | * This means you can pass it multiple variables just like NSLog. 58 | **/ 59 | 60 | #import 61 | 62 | 63 | // Disable legacy macros 64 | #ifndef AWSDD_LEGACY_MACROS 65 | #define AWSDD_LEGACY_MACROS 0 66 | #endif 67 | 68 | // Core 69 | #import "AWSDDLog.h" 70 | 71 | // Main macros 72 | #import "AWSDDLogMacros.h" 73 | #import "AWSDDAssertMacros.h" 74 | 75 | // Capture ASL 76 | #import "AWSDDASLLogCapture.h" 77 | 78 | // Loggers 79 | #import "AWSDDTTYLogger.h" 80 | #import "AWSDDASLLogger.h" 81 | #import "AWSDDFileLogger.h" 82 | #import "AWSDDOSLogger.h" 83 | 84 | // CLI 85 | #if __has_include("CLIColor.h") && TARGET_OS_OSX 86 | #import "CLIColor.h" 87 | #endif 88 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/AWSDDASLLogCapture.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "AWSDDASLLogger.h" 17 | 18 | @protocol AWSDDLogger; 19 | 20 | /** 21 | * This class provides the ability to capture the ASL (Apple System Logs) 22 | */ 23 | @interface AWSDDASLLogCapture : NSObject 24 | 25 | /** 26 | * Start capturing logs 27 | */ 28 | + (void)start; 29 | 30 | /** 31 | * Stop capturing logs 32 | */ 33 | + (void)stop; 34 | 35 | /** 36 | * The current capture level. 37 | * @note Default log level: AWSDDLogLevelVerbose (i.e. capture all ASL messages). 38 | */ 39 | @property (class) AWSDDLogLevel captureLevel; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/AWSDDASLLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | // Disable legacy macros 19 | #ifndef AWSDD_LEGACY_MACROS 20 | #define AWSDD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #import "AWSDDLog.h" 24 | 25 | // Custom key set on messages sent to ASL 26 | extern const char* const kAWSDDASLKeyAWSDDLog; 27 | 28 | // Value set for kAWSDDASLKeyAWSDDLog 29 | extern const char* const kAWSDDASLAWSDDLogValue; 30 | 31 | /** 32 | * This class provides a logger for the Apple System Log facility. 33 | * 34 | * As described in the "Getting Started" page, 35 | * the traditional NSLog() function directs its output to two places: 36 | * 37 | * - Apple System Log 38 | * - StdErr (if stderr is a TTY) so log statements show up in Xcode console 39 | * 40 | * To duplicate NSLog() functionality you can simply add this logger and a tty logger. 41 | * However, if you instead choose to use file logging (for faster performance), 42 | * you may choose to use a file logger and a tty logger. 43 | **/ 44 | @interface AWSDDASLLogger : AWSDDAbstractLogger 45 | 46 | /** 47 | * Singleton method 48 | * 49 | * @return the shared instance 50 | */ 51 | @property (class, readonly, strong) AWSDDASLLogger *sharedInstance; 52 | 53 | // Inherited from AWSDDAbstractLogger 54 | 55 | // - (id )logFormatter; 56 | // - (void)setLogFormatter:(id )formatter; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/AWSDDASLLogger.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "AWSDDASLLogger.h" 17 | #import 18 | 19 | #if !__has_feature(objc_arc) 20 | #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 21 | #endif 22 | 23 | const char* const kAWSDDASLKeyAWSDDLog = "AWSDDLog"; 24 | 25 | const char* const kAWSDDASLAWSDDLogValue = "1"; 26 | 27 | static AWSDDASLLogger *sharedInstance; 28 | 29 | @interface AWSDDASLLogger () { 30 | aslclient _client; 31 | } 32 | 33 | @end 34 | 35 | 36 | @implementation AWSDDASLLogger 37 | 38 | + (instancetype)sharedInstance { 39 | static dispatch_once_t AWSDDASLLoggerOnceToken; 40 | 41 | dispatch_once(&AWSDDASLLoggerOnceToken, ^{ 42 | sharedInstance = [[[self class] alloc] init]; 43 | }); 44 | 45 | return sharedInstance; 46 | } 47 | 48 | - (instancetype)init { 49 | if (sharedInstance != nil) { 50 | return nil; 51 | } 52 | 53 | if ((self = [super init])) { 54 | // A default asl client is provided for the main thread, 55 | // but background threads need to create their own client. 56 | 57 | _client = asl_open(NULL, "com.apple.console", 0); 58 | } 59 | 60 | return self; 61 | } 62 | 63 | - (void)logMessage:(AWSDDLogMessage *)logMessage { 64 | // Skip captured log messages 65 | if ([logMessage->_fileName isEqualToString:@"AWSDDASLLogCapture"]) { 66 | return; 67 | } 68 | 69 | NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message; 70 | 71 | if (message) { 72 | const char *msg = [message UTF8String]; 73 | 74 | size_t aslLogLevel; 75 | switch (logMessage->_flag) { 76 | // Note: By default ASL will filter anything above level 5 (Notice). 77 | // So our mappings shouldn't go above that level. 78 | case AWSDDLogFlagError : aslLogLevel = ASL_LEVEL_CRIT; break; 79 | case AWSDDLogFlagWarning : aslLogLevel = ASL_LEVEL_ERR; break; 80 | case AWSDDLogFlagInfo : aslLogLevel = ASL_LEVEL_WARNING; break; // Regular NSLog's level 81 | case AWSDDLogFlagDebug : 82 | case AWSDDLogFlagVerbose : 83 | default : aslLogLevel = ASL_LEVEL_NOTICE; break; 84 | } 85 | 86 | static char const *const level_strings[] = { "0", "1", "2", "3", "4", "5", "6", "7" }; 87 | 88 | // NSLog uses the current euid to set the ASL_KEY_READ_UID. 89 | uid_t const readUID = geteuid(); 90 | 91 | char readUIDString[16]; 92 | #ifndef NS_BLOCK_ASSERTIONS 93 | size_t l = snprintf(readUIDString, sizeof(readUIDString), "%d", readUID); 94 | #else 95 | snprintf(readUIDString, sizeof(readUIDString), "%d", readUID); 96 | #endif 97 | 98 | NSAssert(l < sizeof(readUIDString), 99 | @"Formatted euid is too long."); 100 | NSAssert(aslLogLevel < (sizeof(level_strings) / sizeof(level_strings[0])), 101 | @"Unhandled ASL log level."); 102 | 103 | aslmsg m = asl_new(ASL_TYPE_MSG); 104 | if (m != NULL) { 105 | if (asl_set(m, ASL_KEY_LEVEL, level_strings[aslLogLevel]) == 0 && 106 | asl_set(m, ASL_KEY_MSG, msg) == 0 && 107 | asl_set(m, ASL_KEY_READ_UID, readUIDString) == 0 && 108 | asl_set(m, kAWSDDASLKeyAWSDDLog, kAWSDDASLAWSDDLogValue) == 0) { 109 | asl_send(_client, m); 110 | } 111 | asl_free(m); 112 | } 113 | //TODO handle asl_* failures non-silently? 114 | } 115 | } 116 | 117 | - (NSString *)loggerName { 118 | return @"cocoa.lumberjack.aslLogger"; 119 | } 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/AWSDDAbstractDatabaseLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | // Disable legacy macros 17 | #ifndef AWSDD_LEGACY_MACROS 18 | #define AWSDD_LEGACY_MACROS 0 19 | #endif 20 | 21 | #import "AWSDDLog.h" 22 | 23 | /** 24 | * This class provides an abstract implementation of a database logger. 25 | * 26 | * That is, it provides the base implementation for a database logger to build atop of. 27 | * All that is needed for a concrete database logger is to extend this class 28 | * and override the methods in the implementation file that are prefixed with "db_". 29 | **/ 30 | @interface AWSDDAbstractDatabaseLogger : AWSDDAbstractLogger { 31 | 32 | @protected 33 | NSUInteger _saveThreshold; 34 | NSTimeInterval _saveInterval; 35 | NSTimeInterval _maxAge; 36 | NSTimeInterval _deleteInterval; 37 | BOOL _deleteOnEverySave; 38 | 39 | BOOL _saveTimerSuspended; 40 | NSUInteger _unsavedCount; 41 | dispatch_time_t _unsavedTime; 42 | dispatch_source_t _saveTimer; 43 | dispatch_time_t _lastDeleteTime; 44 | dispatch_source_t _deleteTimer; 45 | } 46 | 47 | /** 48 | * Specifies how often to save the data to disk. 49 | * Since saving is an expensive operation (disk io) it is not done after every log statement. 50 | * These properties allow you to configure how/when the logger saves to disk. 51 | * 52 | * A save is done when either (whichever happens first): 53 | * 54 | * - The number of unsaved log entries reaches saveThreshold 55 | * - The amount of time since the oldest unsaved log entry was created reaches saveInterval 56 | * 57 | * You can optionally disable the saveThreshold by setting it to zero. 58 | * If you disable the saveThreshold you are entirely dependent on the saveInterval. 59 | * 60 | * You can optionally disable the saveInterval by setting it to zero (or a negative value). 61 | * If you disable the saveInterval you are entirely dependent on the saveThreshold. 62 | * 63 | * It's not wise to disable both saveThreshold and saveInterval. 64 | * 65 | * The default saveThreshold is 500. 66 | * The default saveInterval is 60 seconds. 67 | **/ 68 | @property (assign, readwrite) NSUInteger saveThreshold; 69 | 70 | /** 71 | * See the description for the `saveThreshold` property 72 | */ 73 | @property (assign, readwrite) NSTimeInterval saveInterval; 74 | 75 | /** 76 | * It is likely you don't want the log entries to persist forever. 77 | * Doing so would allow the database to grow infinitely large over time. 78 | * 79 | * The maxAge property provides a way to specify how old a log statement can get 80 | * before it should get deleted from the database. 81 | * 82 | * The deleteInterval specifies how often to sweep for old log entries. 83 | * Since deleting is an expensive operation (disk io) is is done on a fixed interval. 84 | * 85 | * An alternative to the deleteInterval is the deleteOnEverySave option. 86 | * This specifies that old log entries should be deleted during every save operation. 87 | * 88 | * You can optionally disable the maxAge by setting it to zero (or a negative value). 89 | * If you disable the maxAge then old log statements are not deleted. 90 | * 91 | * You can optionally disable the deleteInterval by setting it to zero (or a negative value). 92 | * 93 | * If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted. 94 | * 95 | * It's not wise to enable both deleteInterval and deleteOnEverySave. 96 | * 97 | * The default maxAge is 7 days. 98 | * The default deleteInterval is 5 minutes. 99 | * The default deleteOnEverySave is NO. 100 | **/ 101 | @property (assign, readwrite) NSTimeInterval maxAge; 102 | 103 | /** 104 | * See the description for the `maxAge` property 105 | */ 106 | @property (assign, readwrite) NSTimeInterval deleteInterval; 107 | 108 | /** 109 | * See the description for the `maxAge` property 110 | */ 111 | @property (assign, readwrite) BOOL deleteOnEverySave; 112 | 113 | /** 114 | * Forces a save of any pending log entries (flushes log entries to disk). 115 | **/ 116 | - (void)savePendingLogEntries; 117 | 118 | /** 119 | * Removes any log entries that are older than maxAge. 120 | **/ 121 | - (void)deleteOldLogEntries; 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/AWSDDAssertMacros.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | /** 17 | * NSAsset replacement that will output a log message even when assertions are disabled. 18 | **/ 19 | #define AWSDDAssert(condition, frmt, ...) \ 20 | if (!(condition)) { \ 21 | NSString *description = [NSString stringWithFormat:frmt, ## __VA_ARGS__]; \ 22 | AWSDDLogError(@"%@", description); \ 23 | NSAssert(NO, description); \ 24 | } 25 | #define AWSDDAssertCondition(condition) AWSDDAssert(condition, @"Condition not satisfied: %s", #condition) 26 | 27 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/AWSDDLegacyMacros.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | /** 17 | * Legacy macros used for 1.9.x backwards compatibility. 18 | * 19 | * Imported by default when importing a AWSDDLog.h directly and AWSDD_LEGACY_MACROS is not defined and set to 0. 20 | **/ 21 | #if AWSDD_LEGACY_MACROS 22 | 23 | #warning CocoaLumberjack 1.9.x legacy macros enabled. \ 24 | Disable legacy macros by importing AWSCocoaLumberjack.h or AWSDDLogMacros.h instead of AWSDDLog.h or add `#define AWSDD_LEGACY_MACROS 0` before importing AWSDDLog.h. 25 | 26 | #define LOG_FLAG_ERROR AWSDDLogFlagError 27 | #define LOG_FLAG_WARN AWSDDLogFlagWarning 28 | #define LOG_FLAG_INFO AWSDDLogFlagInfo 29 | #define LOG_FLAG_DEBUG AWSDDLogFlagDebug 30 | #define LOG_FLAG_VERBOSE AWSDDLogFlagVerbose 31 | 32 | #define LOG_LEVEL_OFF AWSDDLogLevelOff 33 | #define LOG_LEVEL_ERROR AWSDDLogLevelError 34 | #define LOG_LEVEL_WARN AWSDDLogLevelWarning 35 | #define LOG_LEVEL_INFO AWSDDLogLevelInfo 36 | #define LOG_LEVEL_DEBUG AWSDDLogLevelDebug 37 | #define LOG_LEVEL_VERBOSE AWSDDLogLevelVerbose 38 | #define LOG_LEVEL_ALL AWSDDLogLevelAll 39 | 40 | #define AWSDD_LOG_ASYNC_ENABLED YES 41 | 42 | #define LOG_ASYNC_ERROR ( NO && AWSDD_LOG_ASYNC_ENABLED) 43 | #define LOG_ASYNC_WARN (YES && AWSDD_LOG_ASYNC_ENABLED) 44 | #define LOG_ASYNC_INFO (YES && AWSDD_LOG_ASYNC_ENABLED) 45 | #define LOG_ASYNC_DEBUG (YES && AWSDD_LOG_ASYNC_ENABLED) 46 | #define LOG_ASYNC_VERBOSE (YES && AWSDD_LOG_ASYNC_ENABLED) 47 | 48 | #define AWSDD_LOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \ 49 | [AWSDDLog log : isAsynchronous \ 50 | level : lvl \ 51 | flag : flg \ 52 | context : ctx \ 53 | file : __FILE__ \ 54 | function : fnct \ 55 | line : __LINE__ \ 56 | tag : atag \ 57 | format : (frmt), ## __VA_ARGS__] 58 | 59 | #define AWSDD_LOG_MAYBE(async, lvl, flg, ctx, fnct, frmt, ...) \ 60 | do { if(lvl & flg) AWSDD_LOG_MACRO(async, lvl, flg, ctx, nil, fnct, frmt, ##__VA_ARGS__); } while(0) 61 | 62 | #define LOG_OBJC_MAYBE(async, lvl, flg, ctx, frmt, ...) \ 63 | AWSDD_LOG_MAYBE(async, lvl, flg, ctx, __PRETTY_FUNCTION__, frmt, ## __VA_ARGS__) 64 | 65 | #define AWSDDLogError(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, LOG_LEVEL_DEF, LOG_FLAG_ERROR, 0, frmt, ##__VA_ARGS__) 66 | #define AWSDDLogWarn(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_WARN, LOG_LEVEL_DEF, LOG_FLAG_WARN, 0, frmt, ##__VA_ARGS__) 67 | #define AWSDDLogInfo(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_INFO, LOG_LEVEL_DEF, LOG_FLAG_INFO, 0, frmt, ##__VA_ARGS__) 68 | #define AWSDDLogDebug(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_DEBUG, LOG_LEVEL_DEF, LOG_FLAG_DEBUG, 0, frmt, ##__VA_ARGS__) 69 | #define AWSDDLogVerbose(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_VERBOSE, LOG_LEVEL_DEF, LOG_FLAG_VERBOSE, 0, frmt, ##__VA_ARGS__) 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/AWSDDLog+LOGV.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | // Disable legacy macros 17 | #ifndef AWSDD_LEGACY_MACROS 18 | #define AWSDD_LEGACY_MACROS 0 19 | #endif 20 | 21 | #import "AWSDDLog.h" 22 | 23 | /** 24 | * Whether async should be used by log messages, excluding error messages that are always sent sync. 25 | **/ 26 | #ifndef LOG_ASYNC_ENABLED 27 | #define LOG_ASYNC_ENABLED YES 28 | #endif 29 | 30 | /** 31 | * This is the single macro that all other macros below compile into. 32 | * This big multiline macro makes all the other macros easier to read. 33 | **/ 34 | #define LOGV_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, avalist) \ 35 | [AWSDDLog log : isAsynchronous \ 36 | level : lvl \ 37 | flag : flg \ 38 | context : ctx \ 39 | file : __FILE__ \ 40 | function : fnct \ 41 | line : __LINE__ \ 42 | tag : atag \ 43 | format : frmt \ 44 | args : avalist] 45 | 46 | /** 47 | * Define version of the macro that only execute if the log level is above the threshold. 48 | * The compiled versions essentially look like this: 49 | * 50 | * if (logFlagForThisLogMsg & ddLogLevel) { execute log message } 51 | * 52 | * When LOG_LEVEL_DEF is defined as ddLogLevel. 53 | * 54 | * As shown further below, Lumberjack actually uses a bitmask as opposed to primitive log levels. 55 | * This allows for a great amount of flexibility and some pretty advanced fine grained logging techniques. 56 | * 57 | * Note that when compiler optimizations are enabled (as they are for your release builds), 58 | * the log messages above your logging threshold will automatically be compiled out. 59 | * 60 | * (If the compiler sees LOG_LEVEL_DEF/ddLogLevel declared as a constant, the compiler simply checks to see 61 | * if the 'if' statement would execute, and if not it strips it from the binary.) 62 | * 63 | * We also define shorthand versions for asynchronous and synchronous logging. 64 | **/ 65 | #define LOGV_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, avalist) \ 66 | do { if(lvl & flg) LOGV_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, avalist); } while(0) 67 | 68 | /** 69 | * Ready to use log macros with no context or tag. 70 | **/ 71 | #define AWSDDLogVError(frmt, avalist) LOGV_MAYBE(NO, LOG_LEVEL_DEF, AWSDDLogFlagError, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 72 | #define AWSDDLogVWarn(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, AWSDDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 73 | #define AWSDDLogVInfo(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, AWSDDLogFlagInfo, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 74 | #define AWSDDLogVDebug(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, AWSDDLogFlagDebug, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 75 | #define AWSDDLogVVerbose(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, AWSDDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 76 | 77 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/AWSDDOSLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | // Disable legacy macros 19 | #ifndef DD_LEGACY_MACROS 20 | #define DD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #import "AWSDDLog.h" 24 | 25 | /** 26 | * This class provides a logger for the Apple os_log facility. 27 | **/ 28 | API_AVAILABLE(ios(10.0), macos(10.12), tvos(10.0), watchos(3.0)) 29 | @interface AWSDDOSLogger : AWSDDAbstractLogger 30 | 31 | /** 32 | * Singleton method 33 | * 34 | * @return the shared instance 35 | */ 36 | @property (class, readonly, strong) AWSDDOSLogger *sharedInstance; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/AWSDDOSLogger.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "AWSDDOSLogger.h" 17 | #import 18 | 19 | static AWSDDOSLogger *sharedInstance; 20 | 21 | @implementation AWSDDOSLogger 22 | 23 | + (instancetype)sharedInstance { 24 | static dispatch_once_t AWSDDOSLoggerOnceToken; 25 | 26 | dispatch_once(&AWSDDOSLoggerOnceToken, ^{ 27 | sharedInstance = [[[self class] alloc] init]; 28 | }); 29 | 30 | return sharedInstance; 31 | } 32 | 33 | - (instancetype)init { 34 | if (sharedInstance != nil) { 35 | return nil; 36 | } 37 | 38 | if (self = [super init]) { 39 | return self; 40 | } 41 | 42 | return nil; 43 | } 44 | 45 | - (void)logMessage:(AWSDDLogMessage *)logMessage { 46 | // Skip captured log messages 47 | if ([logMessage->_fileName isEqualToString:@"AWSDDASLLogCapture"]) { 48 | return; 49 | } 50 | 51 | NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message; 52 | 53 | if (message) { 54 | const char *msg = [message UTF8String]; 55 | 56 | switch (logMessage->_flag) { 57 | case AWSDDLogFlagError : 58 | os_log_error(OS_LOG_DEFAULT, "%{public}s", msg); 59 | break; 60 | case AWSDDLogFlagWarning : 61 | case AWSDDLogFlagInfo : 62 | os_log_info(OS_LOG_DEFAULT, "%{public}s", msg); 63 | break; 64 | case AWSDDLogFlagDebug : 65 | case AWSDDLogFlagVerbose : 66 | default : 67 | os_log_debug(OS_LOG_DEFAULT, "%{public}s", msg); 68 | break; 69 | } 70 | } 71 | } 72 | 73 | - (NSString *)loggerName { 74 | return @"cocoa.lumberjack.osLogger"; 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/Extensions/AWSDDContextFilterLogFormatter.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | // Disable legacy macros 19 | #ifndef AWSDD_LEGACY_MACROS 20 | #define AWSDD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #import "AWSDDLog.h" 24 | 25 | /** 26 | * This class provides a log formatter that filters log statements from a logging context not on the whitelist. 27 | * 28 | * A log formatter can be added to any logger to format and/or filter its output. 29 | * You can learn more about log formatters here: 30 | * Documentation/CustomFormatters.md 31 | * 32 | * You can learn more about logging context's here: 33 | * Documentation/CustomContext.md 34 | * 35 | * But here's a quick overview / refresher: 36 | * 37 | * Every log statement has a logging context. 38 | * These come from the underlying logging macros defined in AWSDDLog.h. 39 | * The default logging context is zero. 40 | * You can define multiple logging context's for use in your application. 41 | * For example, logically separate parts of your app each have a different logging context. 42 | * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context. 43 | **/ 44 | @interface AWSDDContextWhitelistFilterLogFormatter : NSObject 45 | 46 | /** 47 | * Designated default initializer 48 | */ 49 | - (instancetype)init NS_DESIGNATED_INITIALIZER; 50 | 51 | /** 52 | * Add a context to the whitelist 53 | * 54 | * @param loggingContext the context 55 | */ 56 | - (void)addToWhitelist:(NSUInteger)loggingContext; 57 | 58 | /** 59 | * Remove context from whitelist 60 | * 61 | * @param loggingContext the context 62 | */ 63 | - (void)removeFromWhitelist:(NSUInteger)loggingContext; 64 | 65 | /** 66 | * Return the whitelist 67 | */ 68 | @property (readonly, copy) NSArray *whitelist; 69 | 70 | /** 71 | * Check if a context is on the whitelist 72 | * 73 | * @param loggingContext the context 74 | */ 75 | - (BOOL)isOnWhitelist:(NSUInteger)loggingContext; 76 | 77 | @end 78 | 79 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 80 | #pragma mark - 81 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 82 | 83 | /** 84 | * This class provides a log formatter that filters log statements from a logging context on the blacklist. 85 | **/ 86 | @interface AWSDDContextBlacklistFilterLogFormatter : NSObject 87 | 88 | - (instancetype)init NS_DESIGNATED_INITIALIZER; 89 | 90 | /** 91 | * Add a context to the blacklist 92 | * 93 | * @param loggingContext the context 94 | */ 95 | - (void)addToBlacklist:(NSUInteger)loggingContext; 96 | 97 | /** 98 | * Remove context from blacklist 99 | * 100 | * @param loggingContext the context 101 | */ 102 | - (void)removeFromBlacklist:(NSUInteger)loggingContext; 103 | 104 | /** 105 | * Return the blacklist 106 | */ 107 | @property (readonly, copy) NSArray *blacklist; 108 | 109 | 110 | /** 111 | * Check if a context is on the blacklist 112 | * 113 | * @param loggingContext the context 114 | */ 115 | - (BOOL)isOnBlacklist:(NSUInteger)loggingContext; 116 | 117 | @end 118 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/Extensions/AWSDDMultiFormatter.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | // Disable legacy macros 19 | #ifndef AWSDD_LEGACY_MACROS 20 | #define AWSDD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #import "AWSDDLog.h" 24 | 25 | /** 26 | * This formatter can be used to chain different formatters together. 27 | * The log message will processed in the order of the formatters added. 28 | **/ 29 | @interface AWSDDMultiFormatter : NSObject 30 | 31 | /** 32 | * Array of chained formatters 33 | */ 34 | @property (readonly) NSArray> *formatters; 35 | 36 | /** 37 | * Add a new formatter 38 | */ 39 | - (void)addFormatter:(id)formatter NS_SWIFT_NAME(add(_:)); 40 | 41 | /** 42 | * Remove a formatter 43 | */ 44 | - (void)removeFormatter:(id)formatter NS_SWIFT_NAME(remove(_:)); 45 | 46 | /** 47 | * Remove all existing formatters 48 | */ 49 | - (void)removeAllFormatters NS_SWIFT_NAME(removeAll()); 50 | 51 | /** 52 | * Check if a certain formatter is used 53 | */ 54 | - (BOOL)isFormattingWithFormatter:(id)formatter; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Logging/Extensions/AWSDDMultiFormatter.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "AWSDDMultiFormatter.h" 17 | 18 | 19 | #if TARGET_OS_IOS 20 | // Compiling for iOS 21 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later 22 | #define NEEDS_DISPATCH_RETAIN_RELEASE 0 23 | #else // iOS 5.X or earlier 24 | #define NEEDS_DISPATCH_RETAIN_RELEASE 1 25 | #endif 26 | #elif TARGET_OS_WATCH || TARGET_OS_TV 27 | // Compiling for watchOS, tvOS 28 | #define NEEDS_DISPATCH_RETAIN_RELEASE 0 29 | #else 30 | // Compiling for Mac OS X 31 | #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later 32 | #define NEEDS_DISPATCH_RETAIN_RELEASE 0 33 | #else // Mac OS X 10.7 or earlier 34 | #define NEEDS_DISPATCH_RETAIN_RELEASE 1 35 | #endif 36 | #endif 37 | 38 | 39 | #if !__has_feature(objc_arc) 40 | #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 41 | #endif 42 | 43 | 44 | @interface AWSDDMultiFormatter () { 45 | dispatch_queue_t _queue; 46 | NSMutableArray *_formatters; 47 | } 48 | 49 | - (AWSDDLogMessage *)logMessageForLine:(NSString *)line originalMessage:(AWSDDLogMessage *)message; 50 | 51 | @end 52 | 53 | 54 | @implementation AWSDDMultiFormatter 55 | 56 | - (instancetype)init { 57 | self = [super init]; 58 | 59 | if (self) { 60 | #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 61 | _queue = dispatch_queue_create("cocoa.lumberjack.multiformatter", DISPATCH_QUEUE_CONCURRENT); 62 | #else 63 | _queue = dispatch_queue_create("cocoa.lumberjack.multiformatter", NULL); 64 | #endif 65 | _formatters = [NSMutableArray new]; 66 | } 67 | 68 | return self; 69 | } 70 | 71 | #if NEEDS_DISPATCH_RETAIN_RELEASE 72 | - (void)dealloc { 73 | dispatch_release(_queue); 74 | } 75 | 76 | #endif 77 | 78 | #pragma mark Processing 79 | 80 | - (NSString *)formatLogMessage:(AWSDDLogMessage *)logMessage { 81 | __block NSString *line = logMessage->_message; 82 | 83 | dispatch_sync(_queue, ^{ 84 | for (id formatter in _formatters) { 85 | AWSDDLogMessage *message = [self logMessageForLine:line originalMessage:logMessage]; 86 | line = [formatter formatLogMessage:message]; 87 | 88 | if (!line) { 89 | break; 90 | } 91 | } 92 | }); 93 | 94 | return line; 95 | } 96 | 97 | - (AWSDDLogMessage *)logMessageForLine:(NSString *)line originalMessage:(AWSDDLogMessage *)message { 98 | AWSDDLogMessage *newMessage = [message copy]; 99 | 100 | newMessage->_message = line; 101 | return newMessage; 102 | } 103 | 104 | #pragma mark Formatters 105 | 106 | - (NSArray *)formatters { 107 | __block NSArray *formatters; 108 | 109 | dispatch_sync(_queue, ^{ 110 | formatters = [_formatters copy]; 111 | }); 112 | 113 | return formatters; 114 | } 115 | 116 | - (void)addFormatter:(id)formatter { 117 | dispatch_barrier_async(_queue, ^{ 118 | [_formatters addObject:formatter]; 119 | }); 120 | } 121 | 122 | - (void)removeFormatter:(id)formatter { 123 | dispatch_barrier_async(_queue, ^{ 124 | [_formatters removeObject:formatter]; 125 | }); 126 | } 127 | 128 | - (void)removeAllFormatters { 129 | dispatch_barrier_async(_queue, ^{ 130 | [_formatters removeAllObjects]; 131 | }); 132 | } 133 | 134 | - (BOOL)isFormattingWithFormatter:(id)formatter { 135 | __block BOOL hasFormatter; 136 | 137 | dispatch_sync(_queue, ^{ 138 | hasFormatter = [_formatters containsObject:formatter]; 139 | }); 140 | 141 | return hasFormatter; 142 | } 143 | 144 | @end 145 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/AWSMTLReflection.h: -------------------------------------------------------------------------------- 1 | // 2 | // MTLReflection.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2013-03-12. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // Creates a selector from a key and a constant string. 12 | // 13 | // key - The key to insert into the generated selector. This key should be in 14 | // its natural case. 15 | // suffix - A string to append to the key as part of the selector. 16 | // 17 | // Returns a selector, or NULL if the input strings cannot form a valid 18 | // selector. 19 | SEL AWSMTLSelectorWithKeyPattern(NSString *key, const char *suffix) __attribute__((pure, nonnull(1, 2))); 20 | 21 | // Creates a selector from a key and a constant prefix and suffix. 22 | // 23 | // prefix - A string to prepend to the key as part of the selector. 24 | // key - The key to insert into the generated selector. This key should be in 25 | // its natural case, and will have its first letter capitalized when 26 | // inserted. 27 | // suffix - A string to append to the key as part of the selector. 28 | // 29 | // Returns a selector, or NULL if the input strings cannot form a valid 30 | // selector. 31 | SEL AWSMTLSelectorWithCapitalizedKeyPattern(const char *prefix, NSString *key, const char *suffix) __attribute__((pure, nonnull(1, 2, 3))); 32 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/AWSMTLReflection.m: -------------------------------------------------------------------------------- 1 | // 2 | // MTLReflection.m 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2013-03-12. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import "AWSMTLReflection.h" 10 | #import 11 | 12 | SEL AWSMTLSelectorWithKeyPattern(NSString *key, const char *suffix) { 13 | NSUInteger keyLength = [key maximumLengthOfBytesUsingEncoding:NSUTF8StringEncoding]; 14 | NSUInteger suffixLength = strlen(suffix); 15 | 16 | char selector[keyLength + suffixLength + 1]; 17 | 18 | BOOL success = [key getBytes:selector maxLength:keyLength usedLength:&keyLength encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0, key.length) remainingRange:NULL]; 19 | if (!success) return NULL; 20 | 21 | memcpy(selector + keyLength, suffix, suffixLength); 22 | selector[keyLength + suffixLength] = '\0'; 23 | 24 | return sel_registerName(selector); 25 | } 26 | 27 | SEL AWSMTLSelectorWithCapitalizedKeyPattern(const char *prefix, NSString *key, const char *suffix) { 28 | NSUInteger prefixLength = strlen(prefix); 29 | NSUInteger suffixLength = strlen(suffix); 30 | 31 | NSString *initial = [key substringToIndex:1].uppercaseString; 32 | NSUInteger initialLength = [initial maximumLengthOfBytesUsingEncoding:NSUTF8StringEncoding]; 33 | 34 | NSString *rest = [key substringFromIndex:1]; 35 | NSUInteger restLength = [rest maximumLengthOfBytesUsingEncoding:NSUTF8StringEncoding]; 36 | 37 | char selector[prefixLength + initialLength + restLength + suffixLength + 1]; 38 | memcpy(selector, prefix, prefixLength); 39 | 40 | BOOL success = [initial getBytes:selector + prefixLength maxLength:initialLength usedLength:&initialLength encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0, initial.length) remainingRange:NULL]; 41 | if (!success) return NULL; 42 | 43 | success = [rest getBytes:selector + prefixLength + initialLength maxLength:restLength usedLength:&restLength encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0, rest.length) remainingRange:NULL]; 44 | if (!success) return NULL; 45 | 46 | memcpy(selector + prefixLength + initialLength + restLength, suffix, suffixLength); 47 | selector[prefixLength + initialLength + restLength + suffixLength] = '\0'; 48 | 49 | return sel_registerName(selector); 50 | } 51 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/AWSMTLValueTransformer.h: -------------------------------------------------------------------------------- 1 | // 2 | // MTLValueTransformer.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-11. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef id (^AWSMTLValueTransformerBlock)(id); 12 | 13 | // 14 | // A value transformer supporting block-based transformation. 15 | // 16 | @interface AWSMTLValueTransformer : NSValueTransformer 17 | 18 | // Returns a transformer which transforms values using the given block. Reverse 19 | // transformations will not be allowed. 20 | + (instancetype)transformerWithBlock:(AWSMTLValueTransformerBlock)transformationBlock; 21 | 22 | // Returns a transformer which transforms values using the given block, for 23 | // forward or reverse transformations. 24 | + (instancetype)reversibleTransformerWithBlock:(AWSMTLValueTransformerBlock)transformationBlock; 25 | 26 | // Returns a transformer which transforms values using the given blocks. 27 | + (instancetype)reversibleTransformerWithForwardBlock:(AWSMTLValueTransformerBlock)forwardBlock reverseBlock:(AWSMTLValueTransformerBlock)reverseBlock; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/AWSMTLValueTransformer.m: -------------------------------------------------------------------------------- 1 | // 2 | // MTLValueTransformer.m 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-11. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "AWSMTLValueTransformer.h" 10 | 11 | // 12 | // Any MTLValueTransformer supporting reverse transformation. Necessary because 13 | // +allowsReverseTransformation is a class method. 14 | // 15 | @interface AWSMTLReversibleValueTransformer : AWSMTLValueTransformer 16 | @end 17 | 18 | @interface AWSMTLValueTransformer () 19 | 20 | @property (nonatomic, copy, readonly) AWSMTLValueTransformerBlock forwardBlock; 21 | @property (nonatomic, copy, readonly) AWSMTLValueTransformerBlock reverseBlock; 22 | 23 | @end 24 | 25 | @implementation AWSMTLValueTransformer 26 | 27 | #pragma mark Lifecycle 28 | 29 | + (instancetype)transformerWithBlock:(AWSMTLValueTransformerBlock)transformationBlock { 30 | return [[self alloc] initWithForwardBlock:transformationBlock reverseBlock:nil]; 31 | } 32 | 33 | + (instancetype)reversibleTransformerWithBlock:(AWSMTLValueTransformerBlock)transformationBlock { 34 | return [self reversibleTransformerWithForwardBlock:transformationBlock reverseBlock:transformationBlock]; 35 | } 36 | 37 | + (instancetype)reversibleTransformerWithForwardBlock:(AWSMTLValueTransformerBlock)forwardBlock reverseBlock:(AWSMTLValueTransformerBlock)reverseBlock { 38 | return [[AWSMTLReversibleValueTransformer alloc] initWithForwardBlock:forwardBlock reverseBlock:reverseBlock]; 39 | } 40 | 41 | - (id)initWithForwardBlock:(AWSMTLValueTransformerBlock)forwardBlock reverseBlock:(AWSMTLValueTransformerBlock)reverseBlock { 42 | NSParameterAssert(forwardBlock != nil); 43 | 44 | self = [super init]; 45 | if (self == nil) return nil; 46 | 47 | _forwardBlock = [forwardBlock copy]; 48 | _reverseBlock = [reverseBlock copy]; 49 | 50 | return self; 51 | } 52 | 53 | #pragma mark NSValueTransformer 54 | 55 | + (BOOL)allowsReverseTransformation { 56 | return NO; 57 | } 58 | 59 | + (Class)transformedValueClass { 60 | return [NSObject class]; 61 | } 62 | 63 | - (id)transformedValue:(id)value { 64 | return self.forwardBlock(value); 65 | } 66 | 67 | @end 68 | 69 | @implementation AWSMTLReversibleValueTransformer 70 | 71 | #pragma mark Lifecycle 72 | 73 | - (id)initWithForwardBlock:(AWSMTLValueTransformerBlock)forwardBlock reverseBlock:(AWSMTLValueTransformerBlock)reverseBlock { 74 | NSParameterAssert(reverseBlock != nil); 75 | return [super initWithForwardBlock:forwardBlock reverseBlock:reverseBlock]; 76 | } 77 | 78 | #pragma mark NSValueTransformer 79 | 80 | + (BOOL)allowsReverseTransformation { 81 | return YES; 82 | } 83 | 84 | - (id)reverseTransformedValue:(id)value { 85 | return self.reverseBlock(value); 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/AWSMantle.h: -------------------------------------------------------------------------------- 1 | // 2 | // Mantle.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-04. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Mantle. 12 | FOUNDATION_EXPORT double AWSMantleVersionNumber; 13 | 14 | //! Project version string for Mantle. 15 | FOUNDATION_EXPORT const unsigned char AWSMantleVersionString[]; 16 | 17 | #import "AWSMTLJSONAdapter.h" 18 | #import "AWSMTLManagedObjectAdapter.h" 19 | #import "AWSMTLModel.h" 20 | #import "AWSMTLModel+NSCoding.h" 21 | #import "AWSMTLValueTransformer.h" 22 | #import "NSArray+AWSMTLManipulationAdditions.h" 23 | #import "NSDictionary+AWSMTLManipulationAdditions.h" 24 | #import "NSObject+AWSMTLComparisonAdditions.h" 25 | #import "NSValueTransformer+AWSMTLInversionAdditions.h" 26 | #import "NSValueTransformer+AWSMTLPredefinedTransformerAdditions.h" 27 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/NSArray+AWSMTLManipulationAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MTLManipulationAdditions.h 3 | // Mantle 4 | // 5 | // Created by Josh Abernathy on 9/19/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSArray (AWSMTLManipulationAdditions) 12 | 13 | // The first object in the array or nil if the array is empty. 14 | // Forwards to `firstObject` which has been first declared in iOS7, but works with iOS4/10.6. 15 | @property (nonatomic, readonly, strong) id awsmtl_firstObject; 16 | 17 | // Returns a new array without all instances of the given object. 18 | - (NSArray *)awsmtl_arrayByRemovingObject:(id)object; 19 | 20 | // Returns a new array without the first object. If the array is empty, it 21 | // returns the empty array. 22 | - (NSArray *)awsmtl_arrayByRemovingFirstObject; 23 | 24 | // Returns a new array without the last object. If the array is empty, it 25 | // returns the empty array. 26 | - (NSArray *)awsmtl_arrayByRemovingLastObject; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/NSArray+AWSMTLManipulationAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MTLManipulationAdditions.m 3 | // Mantle 4 | // 5 | // Created by Josh Abernathy on 9/19/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSArray+AWSMTLManipulationAdditions.h" 10 | 11 | @interface NSArray (AWSMTLDeclarations) 12 | 13 | // This declaration is needed so Mantle can be compiled with SDK 6 / 10.8. 14 | - (id)firstObject; 15 | 16 | @end 17 | 18 | @implementation NSArray (AWSMTLManipulationAdditions) 19 | 20 | - (id)awsmtl_firstObject { 21 | return self.firstObject; 22 | } 23 | 24 | - (instancetype)awsmtl_arrayByRemovingObject:(id)object { 25 | NSMutableArray *result = [self mutableCopy]; 26 | [result removeObject:object]; 27 | return result; 28 | } 29 | 30 | - (instancetype)awsmtl_arrayByRemovingFirstObject { 31 | if (self.count == 0) return self; 32 | 33 | return [self subarrayWithRange:NSMakeRange(1, self.count - 1)]; 34 | } 35 | 36 | - (instancetype)awsmtl_arrayByRemovingLastObject { 37 | if (self.count == 0) return self; 38 | 39 | return [self subarrayWithRange:NSMakeRange(0, self.count - 1)]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/NSDictionary+AWSMTLManipulationAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+MTLManipulationAdditions.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-24. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSDictionary (AWSMTLManipulationAdditions) 12 | 13 | // Merges the keys and values from the given dictionary into the receiver. If 14 | // both the receiver and `dictionary` have a given key, the value from 15 | // `dictionary` is used. 16 | // 17 | // Returns a new dictionary containing the entries of the receiver combined with 18 | // those of `dictionary`. 19 | - (NSDictionary *)awsmtl_dictionaryByAddingEntriesFromDictionary:(NSDictionary *)dictionary; 20 | 21 | // Creates a new dictionary with all the entries for the given keys removed from 22 | // the receiver. 23 | - (NSDictionary *)awsmtl_dictionaryByRemovingEntriesWithKeys:(NSSet *)keys; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/NSDictionary+AWSMTLManipulationAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+MTLManipulationAdditions.m 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-24. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSDictionary+AWSMTLManipulationAdditions.h" 10 | 11 | @implementation NSDictionary (AWSMTLManipulationAdditions) 12 | 13 | - (NSDictionary *)awsmtl_dictionaryByAddingEntriesFromDictionary:(NSDictionary *)dictionary { 14 | NSMutableDictionary *result = [self mutableCopy]; 15 | [result addEntriesFromDictionary:dictionary]; 16 | return result; 17 | } 18 | 19 | - (NSDictionary *)awsmtl_dictionaryByRemovingEntriesWithKeys:(NSSet *)keys { 20 | NSMutableDictionary *result = [self mutableCopy]; 21 | [result removeObjectsForKeys:keys.allObjects]; 22 | return result; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/NSError+AWSMTLModelException.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSError+MTLModelException.h 3 | // Mantle 4 | // 5 | // Created by Robert Böhnke on 7/6/13. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSError (AWSMTLModelException) 12 | 13 | // Creates a new error for an exception that occured during updating an 14 | // MTLModel. 15 | // 16 | // exception - The exception that was thrown while updating the model. 17 | // This argument must not be nil. 18 | // 19 | // Returns an error that takes its localized description and failure reason 20 | // from the exception. 21 | + (instancetype)awsmtl_modelErrorWithException:(NSException *)exception; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/NSError+AWSMTLModelException.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSError+MTLModelException.m 3 | // Mantle 4 | // 5 | // Created by Robert Böhnke on 7/6/13. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import "AWSMTLModel.h" 10 | 11 | #import "NSError+AWSMTLModelException.h" 12 | 13 | // The domain for errors originating from MTLModel. 14 | static NSString * const AWSMTLModelErrorDomain = @"AWSMTLModelErrorDomain"; 15 | 16 | // An exception was thrown and caught. 17 | static const NSInteger AWSMTLModelErrorExceptionThrown = 1; 18 | 19 | // Associated with the NSException that was caught. 20 | static NSString * const AWSMTLModelThrownExceptionErrorKey = @"AWSMTLModelThrownException"; 21 | 22 | @implementation NSError (AWSMTLModelException) 23 | 24 | + (instancetype)awsmtl_modelErrorWithException:(NSException *)exception { 25 | NSParameterAssert(exception != nil); 26 | 27 | NSDictionary *userInfo = @{ 28 | NSLocalizedDescriptionKey: exception.description, 29 | NSLocalizedFailureReasonErrorKey: exception.reason, 30 | AWSMTLModelThrownExceptionErrorKey: exception 31 | }; 32 | 33 | return [NSError errorWithDomain:AWSMTLModelErrorDomain code:AWSMTLModelErrorExceptionThrown userInfo:userInfo]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/NSObject+AWSMTLComparisonAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MTLComparisonAdditions.h 3 | // Mantle 4 | // 5 | // Created by Josh Vera on 10/26/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | // Portions copyright (c) 2011 Bitswift. All rights reserved. 9 | // See the LICENSE file for more information. 10 | // 11 | 12 | #import 13 | 14 | // Returns whether both objects are identical or equal via -isEqual: 15 | BOOL AWSMTLEqualObjects(id obj1, id obj2); 16 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/NSObject+AWSMTLComparisonAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MTLComparisonAdditions.m 3 | // Mantle 4 | // 5 | // Created by Josh Vera on 10/26/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | // Portions copyright (c) 2011 Bitswift. All rights reserved. 9 | // See the LICENSE file for more information. 10 | // 11 | 12 | #import "NSObject+AWSMTLComparisonAdditions.h" 13 | 14 | BOOL AWSMTLEqualObjects(id obj1, id obj2) { 15 | return (obj1 == obj2 || [obj1 isEqual:obj2]); 16 | } 17 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/NSValueTransformer+AWSMTLInversionAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSValueTransformer+MTLInversionAdditions.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2013-05-18. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSValueTransformer (AWSMTLInversionAdditions) 12 | 13 | // Flips the direction of the receiver's transformation, such that 14 | // -transformedValue: will become -reverseTransformedValue:, and vice-versa. 15 | // 16 | // The receiver must allow reverse transformation. 17 | // 18 | // Returns an inverted transformer. 19 | - (NSValueTransformer *)awsmtl_invertedTransformer; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/NSValueTransformer+AWSMTLInversionAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSValueTransformer+MTLInversionAdditions.m 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2013-05-18. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSValueTransformer+AWSMTLInversionAdditions.h" 10 | #import "AWSMTLValueTransformer.h" 11 | 12 | @implementation NSValueTransformer (AWSMTLInversionAdditions) 13 | 14 | - (NSValueTransformer *)awsmtl_invertedTransformer { 15 | NSParameterAssert(self.class.allowsReverseTransformation); 16 | 17 | return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^(id value) { 18 | return [self reverseTransformedValue:value]; 19 | } reverseBlock:^(id value) { 20 | return [self transformedValue:value]; 21 | }]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/NSValueTransformer+AWSMTLPredefinedTransformerAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSValueTransformer+MTLPredefinedTransformerAdditions.h 3 | // Mantle 4 | // 5 | // Created by Justin Spahr-Summers on 2012-09-27. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | void awsmtl_loadMTLPredefinedTransformerAdditions(); 12 | 13 | // The name for a value transformer that converts strings into URLs and back. 14 | extern NSString * const AWSMTLURLValueTransformerName; 15 | 16 | // Ensure an NSNumber is backed by __NSCFBoolean/CFBooleanRef 17 | // 18 | // NSJSONSerialization, and likely other serialization libraries, ordinarily 19 | // serialize NSNumbers as numbers, and thus booleans would be serialized as 20 | // 0/1. The exception is when the NSNumber is backed by __NSCFBoolean, which, 21 | // though very much an implementation detail, is detected and serialized as a 22 | // proper boolean. 23 | extern NSString * const AWSMTLBooleanValueTransformerName; 24 | 25 | @interface NSValueTransformer (AWSMTLPredefinedTransformerAdditions) 26 | 27 | // Creates a reversible transformer to convert a JSON dictionary into a MTLModel 28 | // object, and vice-versa. 29 | // 30 | // modelClass - The MTLModel subclass to attempt to parse from the JSON. This 31 | // class must conform to . This argument must 32 | // not be nil. 33 | // 34 | // Returns a reversible transformer which uses MTLJSONAdapter for transforming 35 | // values back and forth. 36 | + (NSValueTransformer *)awsmtl_JSONDictionaryTransformerWithModelClass:(Class)modelClass; 37 | 38 | // Creates a reversible transformer to convert an array of JSON dictionaries 39 | // into an array of MTLModel objects, and vice-versa. 40 | // 41 | // modelClass - The MTLModel subclass to attempt to parse from each JSON 42 | // dictionary. This class must conform to . 43 | // This argument must not be nil. 44 | // 45 | // Returns a reversible transformer which uses MTLJSONAdapter for transforming 46 | // array elements back and forth. 47 | + (NSValueTransformer *)awsmtl_JSONArrayTransformerWithModelClass:(Class)modelClass; 48 | 49 | // A reversible value transformer to transform between the keys and objects of a 50 | // dictionary. 51 | // 52 | // dictionary - The dictionary whose keys and values should be 53 | // transformed between. This argument must not be nil. 54 | // defaultValue - The result to fall back to, in case no key matching the 55 | // input value was found during a forward transformation. 56 | // reverseDefaultValue - The result to fall back to, in case no value matching 57 | // the input value was found during a reverse 58 | // transformation. 59 | // 60 | // Can for example be used for transforming between enum values and their string 61 | // representation. 62 | // 63 | // NSValueTransformer *valueTransformer = [NSValueTransformer awsmtl_valueMappingTransformerWithDictionary:@{ 64 | // @"foo": @(EnumDataTypeFoo), 65 | // @"bar": @(EnumDataTypeBar), 66 | // } defaultValue: @(EnumDataTypeUndefined) reverseDefaultValue: @"undefined"]; 67 | // 68 | // Returns a transformer that will map from keys to values in dictionary 69 | // for forward transformation, and from values to keys for reverse 70 | // transformations. If no matching key or value can be found, the respective 71 | // default value is returned. 72 | + (NSValueTransformer *)awsmtl_valueMappingTransformerWithDictionary:(NSDictionary *)dictionary defaultValue:(id)defaultValue reverseDefaultValue:(id)reverseDefaultValue; 73 | 74 | // Returns a value transformer created by calling 75 | // `+mtl_valueMappingTransformerWithDictionary:defaultValue:reverseDefaultValue:` 76 | // with a default value of `nil` and a reverse default value of `nil`. 77 | + (NSValueTransformer *)awsmtl_valueMappingTransformerWithDictionary:(NSDictionary *)dictionary; 78 | 79 | @end 80 | 81 | @interface NSValueTransformer (UnavailableAWSMTLPredefinedTransformerAdditions) 82 | 83 | + (NSValueTransformer *)awsmtl_externalRepresentationTransformerWithModelClass:(Class)modelClass __attribute__((deprecated("Replaced by +mtl_JSONDictionaryTransformerWithModelClass:"))); 84 | + (NSValueTransformer *)awsmtl_externalRepresentationArrayTransformerWithModelClass:(Class)modelClass __attribute__((deprecated("Replaced by +mtl_JSONArrayTransformerWithModelClass:"))); 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/extobjc/AWSEXTKeyPathCoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // EXTKeyPathCoding.h 3 | // extobjc 4 | // 5 | // Created by Justin Spahr-Summers on 19.06.12. 6 | // Copyright (C) 2012 Justin Spahr-Summers. 7 | // Released under the MIT license. 8 | // 9 | 10 | #import 11 | #import "AWSmetamacros.h" 12 | 13 | /** 14 | * \@keypath allows compile-time verification of key paths. Given a real object 15 | * receiver and key path: 16 | * 17 | * @code 18 | 19 | NSString *UTF8StringPath = @keypath(str.lowercaseString.UTF8String); 20 | // => @"lowercaseString.UTF8String" 21 | 22 | NSString *versionPath = @keypath(NSObject, version); 23 | // => @"version" 24 | 25 | NSString *lowercaseStringPath = @keypath(NSString.new, lowercaseString); 26 | // => @"lowercaseString" 27 | 28 | * @endcode 29 | * 30 | * ... the macro returns an \c NSString containing all but the first path 31 | * component or argument (e.g., @"lowercaseString.UTF8String", @"version"). 32 | * 33 | * In addition to simply creating a key path, this macro ensures that the key 34 | * path is valid at compile-time (causing a syntax error if not), and supports 35 | * refactoring, such that changing the name of the property will also update any 36 | * uses of \@keypath. 37 | */ 38 | #define keypath(...) \ 39 | metamacro_if_eq(1, metamacro_argcount(__VA_ARGS__))(keypath1(__VA_ARGS__))(keypath2(__VA_ARGS__)) 40 | 41 | #define keypath1(PATH) \ 42 | (((void)(NO && ((void)PATH, NO)), strchr(# PATH, '.') + 1)) 43 | 44 | #define keypath2(OBJ, PATH) \ 45 | (((void)(NO && ((void)OBJ.PATH, NO)), # PATH)) 46 | 47 | /** 48 | * \@collectionKeypath allows compile-time verification of key paths across collections NSArray/NSSet etc. Given a real object 49 | * receiver, collection object receiver and related keypaths: 50 | * 51 | * @code 52 | 53 | NSString *employessFirstNamePath = @collectionKeypath(department.employees, Employee.new, firstName) 54 | // => @"employees.firstName" 55 | 56 | NSString *employessFirstNamePath = @collectionKeypath(Department.new, employees, Employee.new, firstName) 57 | // => @"employees.firstName" 58 | 59 | * @endcode 60 | * 61 | */ 62 | #define collectionKeypath(...) \ 63 | metamacro_if_eq(3, metamacro_argcount(__VA_ARGS__))(collectionKeypath3(__VA_ARGS__))(collectionKeypath4(__VA_ARGS__)) 64 | 65 | #define collectionKeypath3(PATH, COLLECTION_OBJECT, COLLECTION_PATH) ([[NSString stringWithFormat:@"%s.%s",keypath(PATH), keypath(COLLECTION_OBJECT, COLLECTION_PATH)] UTF8String]) 66 | 67 | #define collectionKeypath4(OBJ, PATH, COLLECTION_OBJECT, COLLECTION_PATH) ([[NSString stringWithFormat:@"%s.%s",keypath(OBJ, PATH), keypath(COLLECTION_OBJECT, COLLECTION_PATH)] UTF8String]) 68 | 69 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/extobjc/AWSEXTRuntimeExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // EXTRuntimeExtensions.h 3 | // extobjc 4 | // 5 | // Created by Justin Spahr-Summers on 2011-03-05. 6 | // Copyright (C) 2012 Justin Spahr-Summers. 7 | // Released under the MIT license. 8 | // 9 | 10 | #import 11 | 12 | /** 13 | * Describes the memory management policy of a property. 14 | */ 15 | typedef enum { 16 | /** 17 | * The value is assigned. 18 | */ 19 | awsmtl_propertyMemoryManagementPolicyAssign = 0, 20 | 21 | /** 22 | * The value is retained. 23 | */ 24 | awsmtl_propertyMemoryManagementPolicyRetain, 25 | 26 | /** 27 | * The value is copied. 28 | */ 29 | awsmtl_propertyMemoryManagementPolicyCopy 30 | } awsmtl_propertyMemoryManagementPolicy; 31 | 32 | /** 33 | * Describes the attributes and type information of a property. 34 | */ 35 | typedef struct { 36 | /** 37 | * Whether this property was declared with the \c readonly attribute. 38 | */ 39 | BOOL readonly; 40 | 41 | /** 42 | * Whether this property was declared with the \c nonatomic attribute. 43 | */ 44 | BOOL nonatomic; 45 | 46 | /** 47 | * Whether the property is a weak reference. 48 | */ 49 | BOOL weak; 50 | 51 | /** 52 | * Whether the property is eligible for garbage collection. 53 | */ 54 | BOOL canBeCollected; 55 | 56 | /** 57 | * Whether this property is defined with \c \@dynamic. 58 | */ 59 | BOOL dynamic; 60 | 61 | /** 62 | * The memory management policy for this property. This will always be 63 | * #mtl_propertyMemoryManagementPolicyAssign if #readonly is \c YES. 64 | */ 65 | awsmtl_propertyMemoryManagementPolicy memoryManagementPolicy; 66 | 67 | /** 68 | * The selector for the getter of this property. This will reflect any 69 | * custom \c getter= attribute provided in the property declaration, or the 70 | * inferred getter name otherwise. 71 | */ 72 | SEL getter; 73 | 74 | /** 75 | * The selector for the setter of this property. This will reflect any 76 | * custom \c setter= attribute provided in the property declaration, or the 77 | * inferred setter name otherwise. 78 | * 79 | * @note If #readonly is \c YES, this value will represent what the setter 80 | * \e would be, if the property were writable. 81 | */ 82 | SEL setter; 83 | 84 | /** 85 | * The backing instance variable for this property, or \c NULL if \c 86 | * \c @synthesize was not used, and therefore no instance variable exists. This 87 | * would also be the case if the property is implemented dynamically. 88 | */ 89 | const char *ivar; 90 | 91 | /** 92 | * If this property is defined as being an instance of a specific class, 93 | * this will be the class object representing it. 94 | * 95 | * This will be \c nil if the property was defined as type \c id, if the 96 | * property is not of an object type, or if the class could not be found at 97 | * runtime. 98 | */ 99 | Class objectClass; 100 | 101 | /** 102 | * The type encoding for the value of this property. This is the type as it 103 | * would be returned by the \c \@encode() directive. 104 | */ 105 | char type[]; 106 | } awsmtl_propertyAttributes; 107 | 108 | /** 109 | * Returns a pointer to a structure containing information about \a property. 110 | * You must \c free() the returned pointer. Returns \c NULL if there is an error 111 | * obtaining information from \a property. 112 | */ 113 | awsmtl_propertyAttributes *awsmtl_copyPropertyAttributes (objc_property_t property); 114 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/extobjc/AWSEXTScope.h: -------------------------------------------------------------------------------- 1 | // 2 | // EXTScope.h 3 | // extobjc 4 | // 5 | // Created by Justin Spahr-Summers on 2011-05-04. 6 | // Copyright (C) 2012 Justin Spahr-Summers. 7 | // Released under the MIT license. 8 | // 9 | 10 | #import "AWSmetamacros.h" 11 | 12 | /** 13 | * \@onExit defines some code to be executed when the current scope exits. The 14 | * code must be enclosed in braces and terminated with a semicolon, and will be 15 | * executed regardless of how the scope is exited, including from exceptions, 16 | * \c goto, \c return, \c break, and \c continue. 17 | * 18 | * Provided code will go into a block to be executed later. Keep this in mind as 19 | * it pertains to memory management, restrictions on assignment, etc. Because 20 | * the code is used within a block, \c return is a legal (though perhaps 21 | * confusing) way to exit the cleanup block early. 22 | * 23 | * Multiple \@onExit statements in the same scope are executed in reverse 24 | * lexical order. This helps when pairing resource acquisition with \@onExit 25 | * statements, as it guarantees teardown in the opposite order of acquisition. 26 | * 27 | * @note This statement cannot be used within scopes defined without braces 28 | * (like a one line \c if). In practice, this is not an issue, since \@onExit is 29 | * a useless construct in such a case anyways. 30 | */ 31 | #define onExit \ 32 | try {} @finally {} \ 33 | __strong awsmtl_cleanupBlock_t metamacro_concat(mtl_exitBlock_, __LINE__) __attribute__((cleanup(awsmtl_executeCleanupBlock), unused)) = ^ 34 | 35 | /** 36 | * Creates \c __weak shadow variables for each of the variables provided as 37 | * arguments, which can later be made strong again with #strongify. 38 | * 39 | * This is typically used to weakly reference variables in a block, but then 40 | * ensure that the variables stay alive during the actual execution of the block 41 | * (if they were live upon entry). 42 | * 43 | * See #strongify for an example of usage. 44 | */ 45 | #define weakify(...) \ 46 | try {} @finally {} \ 47 | metamacro_foreach_cxt(mtl_weakify_,, __weak, __VA_ARGS__) 48 | 49 | /** 50 | * Like #weakify, but uses \c __unsafe_unretained instead, for targets or 51 | * classes that do not support weak references. 52 | */ 53 | #define unsafeify(...) \ 54 | try {} @finally {} \ 55 | metamacro_foreach_cxt(mtl_weakify_,, __unsafe_unretained, __VA_ARGS__) 56 | 57 | /** 58 | * Strongly references each of the variables provided as arguments, which must 59 | * have previously been passed to #weakify. 60 | * 61 | * The strong references created will shadow the original variable names, such 62 | * that the original names can be used without issue (and a significantly 63 | * reduced risk of retain cycles) in the current scope. 64 | * 65 | * @code 66 | 67 | id foo = [[NSObject alloc] init]; 68 | id bar = [[NSObject alloc] init]; 69 | 70 | @weakify(foo, bar); 71 | 72 | // this block will not keep 'foo' or 'bar' alive 73 | BOOL (^matchesFooOrBar)(id) = ^ BOOL (id obj){ 74 | // but now, upon entry, 'foo' and 'bar' will stay alive until the block has 75 | // finished executing 76 | @strongify(foo, bar); 77 | 78 | return [foo isEqual:obj] || [bar isEqual:obj]; 79 | }; 80 | 81 | * @endcode 82 | */ 83 | #define strongify(...) \ 84 | try {} @finally {} \ 85 | _Pragma("clang diagnostic push") \ 86 | _Pragma("clang diagnostic ignored \"-Wshadow\"") \ 87 | metamacro_foreach(mtl_strongify_,, __VA_ARGS__) \ 88 | _Pragma("clang diagnostic pop") 89 | 90 | /*** implementation details follow ***/ 91 | typedef void (^awsmtl_cleanupBlock_t)(); 92 | 93 | void awsmtl_executeCleanupBlock (__strong awsmtl_cleanupBlock_t *block); 94 | 95 | #define awsmtl_weakify_(INDEX, CONTEXT, VAR) \ 96 | CONTEXT __typeof__(VAR) metamacro_concat(VAR, _weak_) = (VAR); 97 | 98 | #define awsmtl_strongify_(INDEX, VAR) \ 99 | __strong __typeof__(VAR) VAR = metamacro_concat(VAR, _weak_); 100 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Mantle/extobjc/AWSEXTScope.m: -------------------------------------------------------------------------------- 1 | // 2 | // EXTScope.m 3 | // extobjc 4 | // 5 | // Created by Justin Spahr-Summers on 2011-05-04. 6 | // Copyright (C) 2012 Justin Spahr-Summers. 7 | // Released under the MIT license. 8 | // 9 | 10 | #import "AWSEXTScope.h" 11 | 12 | void awsmtl_executeCleanupBlock (__strong awsmtl_cleanupBlock_t *block) { 13 | (*block)(); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Networking/AWSURLSessionManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | #import "AWSNetworking.h" 18 | 19 | @interface AWSURLSessionManager : NSObject 20 | 21 | @property (nonatomic, strong) AWSNetworkingConfiguration *configuration; 22 | 23 | - (instancetype)initWithConfiguration:(AWSNetworkingConfiguration *)configuration; 24 | 25 | - (AWSTask *)dataTaskWithRequest:(AWSNetworkingRequest *)request; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/STS/AWSSTS.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | 19 | 20 | 21 | #import "AWSCore.h" 22 | #import "AWSSTSService.h" 23 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/STS/AWSSTSResources.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | @interface AWSSTSResources : NSObject 19 | 20 | + (instancetype)sharedInstance; 21 | 22 | - (NSDictionary *)JSONObject; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Serialization/AWSURLRequestRetryHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | #import "AWSNetworking.h" 19 | 20 | @interface AWSURLRequestRetryHandler : NSObject 21 | 22 | @property (nonatomic, assign) uint32_t maxRetryCount; 23 | 24 | - (instancetype)initWithMaximumRetryCount:(uint32_t)maxRetryCount; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Serialization/AWSURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | #import "AWSNetworking.h" 19 | #import "AWSSerialization.h" 20 | 21 | @interface AWSJSONRequestSerializer : NSObject 22 | 23 | - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition 24 | actionName:(NSString *)actionName; 25 | 26 | @end 27 | 28 | @interface AWSXMLRequestSerializer : NSObject 29 | 30 | - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition 31 | actionName:(NSString *)actionName; 32 | 33 | + (BOOL)constructURIandHeadersAndBody:(NSMutableURLRequest *)request 34 | rules:(AWSJSONDictionary *)rules 35 | parameters:(NSDictionary *)params 36 | uriSchema:(NSString *)uriSchema 37 | error:(NSError *__autoreleasing *)error; 38 | @end 39 | 40 | @interface AWSQueryStringRequestSerializer : NSObject 41 | 42 | - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition 43 | actionName:(NSString *)actionName; 44 | 45 | @property (nonatomic, strong) NSDictionary *additionalParameters; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Serialization/AWSURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | #import "AWSNetworking.h" 19 | #import "AWSSerialization.h" 20 | 21 | @interface AWSJSONResponseSerializer : NSObject 22 | 23 | @property (nonatomic, strong, readonly) NSDictionary *serviceDefinitionJSON; 24 | @property (nonatomic, strong, readonly) NSString *actionName; 25 | @property (nonatomic, assign, readonly) Class outputClass; 26 | 27 | - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition 28 | actionName:(NSString *)actionName 29 | outputClass:(Class)outputClass; 30 | 31 | @end 32 | 33 | @interface AWSXMLResponseSerializer : NSObject 34 | 35 | @property (nonatomic, assign) Class outputClass; 36 | 37 | - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition 38 | actionName:(NSString *)actionName 39 | outputClass:(Class)outputClass; 40 | 41 | + (NSMutableDictionary *)parseResponse:(NSHTTPURLResponse *)response 42 | rules:(AWSJSONDictionary *)rules 43 | bodyDictionary:(NSMutableDictionary *)bodyDictionary 44 | error:(NSError *__autoreleasing *)error; 45 | @end 46 | 47 | 48 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Serialization/AWSValidation.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | // defined domain for errors from AWSRuntime. 19 | FOUNDATION_EXPORT NSString *const AWSValidationErrorDomain; 20 | 21 | /* NSError codes in AWSErrorDomain. */ 22 | typedef NS_ENUM(NSInteger, AWSValidationErrorType) { 23 | // AWSJSON Validation related errors 24 | AWSValidationUnknownError, // Unknown Error found during JSON Validation 25 | AWSValidationUnexpectedParameter, // Unexpected Parameters found in HTTP Body 26 | AWSValidationUnhandledType, 27 | AWSValidationMissingRequiredParameter, 28 | AWSValidationOutOfRangeParameter, 29 | AWSValidationInvalidStringParameter, 30 | AWSValidationUnexpectedStringParameter, 31 | AWSValidationInvalidParameterType, 32 | AWSValidationInvalidBase64Data, 33 | AWSValidationHeaderTargetInvalid, 34 | AWSValidationHeaderAPIActionIsUndefined, 35 | AWSValidationHeaderDefinitionFileIsNotFound, 36 | AWSValidationHeaderDefinitionFileIsEmpty, 37 | AWSValidationHeaderAPIActionIsInvalid, 38 | AWSValidationURIIsInvalid 39 | }; 40 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Serialization/AWSValidation.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import "AWSValidation.h" 17 | #import "AWSCategory.h" 18 | 19 | NSString *const AWSValidationErrorDomain = @"com.amazonaws.AWSValidationErrorDomain"; 20 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Service/AWSClientContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | FOUNDATION_EXPORT NSString *const AWSClientContextVersion; 19 | FOUNDATION_EXPORT NSString *const AWSClientContextHeader; 20 | FOUNDATION_EXPORT NSString *const AWSClientContextHeaderEncoding; 21 | 22 | @interface AWSClientContext : NSObject 23 | 24 | #pragma mark - App Details 25 | @property (nonatomic, strong, readonly) NSString *installationId; 26 | @property (nonatomic, strong) NSString *appVersion; 27 | @property (nonatomic, strong) NSString *appBuild; 28 | @property (nonatomic, strong) NSString *appPackageName; 29 | @property (nonatomic, strong) NSString *appName; 30 | 31 | #pragma mark - Device Details 32 | @property (nonatomic, strong) NSString *devicePlatformVersion; 33 | @property (nonatomic, strong) NSString *devicePlatform; 34 | @property (nonatomic, strong) NSString *deviceManufacturer; 35 | @property (nonatomic, strong) NSString *deviceModel; 36 | @property (nonatomic, strong) NSString *deviceModelVersion; 37 | @property (nonatomic, strong) NSString *deviceLocale; 38 | 39 | #pragma mark - Custom Attributes 40 | @property (nonatomic, strong) NSDictionary *customAttributes; 41 | 42 | #pragma mark - Service Details 43 | @property (nonatomic, strong, readonly) NSDictionary *serviceDetails; 44 | 45 | - (instancetype)init; 46 | 47 | - (NSDictionary *)dictionaryRepresentation; 48 | 49 | - (NSString *)JSONString; 50 | 51 | - (NSString *)base64EncodedJSONString; 52 | 53 | - (void)setDetails:(id)details 54 | forService:(NSString *)service; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Service/AWSInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | #import "AWSServiceEnum.h" 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | FOUNDATION_EXPORT NSString *const AWSInfoDefault; 22 | 23 | @class AWSServiceInfo; 24 | @class AWSCognitoCredentialsProvider; 25 | 26 | @interface AWSInfo : NSObject 27 | 28 | @property (nonatomic, readonly) NSDictionary *rootInfoDictionary; 29 | 30 | + (instancetype)defaultAWSInfo; 31 | 32 | - (nullable AWSServiceInfo *)serviceInfo:(NSString *)serviceName 33 | forKey:(NSString *)key; 34 | 35 | - (nullable AWSServiceInfo *)defaultServiceInfo:(NSString *)serviceName; 36 | 37 | @end 38 | 39 | @interface AWSServiceInfo : NSObject 40 | 41 | @property (nonatomic, readonly) AWSCognitoCredentialsProvider *cognitoCredentialsProvider; 42 | 43 | @property (nonatomic, readonly) AWSRegionType region; 44 | 45 | @property (nonatomic, readonly) NSDictionary *infoDictionary; 46 | 47 | @end 48 | 49 | NS_ASSUME_NONNULL_END 50 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/TMCache/AWSTMCacheBackgroundTaskManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // TMCacheBackgroundTaskManager.h 3 | // TMCache 4 | // 5 | // Created by Bryan Irace on 4/24/15. 6 | // Copyright (c) 2015 Tumblr. All rights reserved. 7 | // 8 | 9 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_4_0 10 | #import 11 | #else 12 | typedef NSUInteger UIBackgroundTaskIdentifier; 13 | #endif 14 | 15 | /** 16 | A protocol that classes who can begin and end background tasks can conform to. This protocol provides an abstraction in 17 | order to avoid referencing `+ [UIApplication sharedApplication]` from within an iOS application extension. 18 | */ 19 | @protocol AWSTMCacheBackgroundTaskManager 20 | 21 | /** 22 | Marks the beginning of a new long-running background task. 23 | 24 | @return A unique identifier for the new background task. You must pass this value to the `endBackgroundTask:` method to 25 | mark the end of this task. This method returns `UIBackgroundTaskInvalid` if running in the background is not possible. 26 | */ 27 | - (UIBackgroundTaskIdentifier)beginBackgroundTask; 28 | 29 | /** 30 | Marks the end of a specific long-running background task. 31 | 32 | @param identifier An identifier returned by the `beginBackgroundTaskWithExpirationHandler:` method. 33 | */ 34 | - (void)endBackgroundTask:(UIBackgroundTaskIdentifier)identifier; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Utility/AWSCategory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | #import "AWSServiceEnum.h" 18 | 19 | FOUNDATION_EXPORT NSString *const AWSDateRFC822DateFormat1; 20 | FOUNDATION_EXPORT NSString *const AWSDateISO8601DateFormat1; 21 | FOUNDATION_EXPORT NSString *const AWSDateISO8601DateFormat2; 22 | FOUNDATION_EXPORT NSString *const AWSDateISO8601DateFormat3; 23 | FOUNDATION_EXPORT NSString *const AWSDateShortDateFormat1; 24 | FOUNDATION_EXPORT NSString *const AWSDateShortDateFormat2; 25 | 26 | @interface NSDate (AWS) 27 | 28 | + (NSDate *)aws_clockSkewFixedDate; 29 | 30 | + (NSDate *)aws_dateFromString:(NSString *)string; 31 | + (NSDate *)aws_dateFromString:(NSString *)string format:(NSString *)dateFormat; 32 | - (NSString *)aws_stringValue:(NSString *)dateFormat; 33 | 34 | /** 35 | * Set the clock skew for the current device. This clock skew will be used for calculating 36 | * signatures to AWS signatures and for parsing/converting date values from responses. 37 | * 38 | * @param clockskew the skew (in seconds) for this device. If the clock on the device is fast, pass positive skew to correct. If the clock on the device is slow, pass negative skew to correct. 39 | */ 40 | + (void)aws_setRuntimeClockSkew:(NSTimeInterval)clockskew; 41 | 42 | /** 43 | * Get the clock skew for the current device. 44 | * 45 | * @return the skew (in seconds) currently set for this device. Positive clock skew implies the device is fast, negative implies the device is slow. 46 | */ 47 | + (NSTimeInterval)aws_getRuntimeClockSkew; 48 | 49 | @end 50 | 51 | @interface NSDictionary (AWS) 52 | 53 | - (NSDictionary *)aws_removeNullValues; 54 | - (id)aws_objectForCaseInsensitiveKey:(id)aKey; 55 | 56 | @end 57 | 58 | @interface NSJSONSerialization (AWS) 59 | 60 | + (NSData *)aws_dataWithJSONObject:(id)obj 61 | options:(NSJSONWritingOptions)opt 62 | error:(NSError **)error; 63 | 64 | @end 65 | 66 | @interface NSNumber (AWS) 67 | 68 | + (NSNumber *)aws_numberFromString:(NSString *)string; 69 | 70 | @end 71 | 72 | @interface NSObject (AWS) 73 | 74 | - (NSDictionary *)aws_properties; 75 | - (void)aws_copyPropertiesFromObject:(NSObject *)object; 76 | 77 | @end 78 | 79 | @interface NSString (AWS) 80 | 81 | + (NSString *)aws_base64md5FromData:(NSData *)data; 82 | - (BOOL)aws_isBase64Data; 83 | - (NSString *)aws_stringWithURLEncoding; 84 | - (NSString *)aws_stringWithURLEncodingPath; 85 | - (NSString *)aws_stringWithURLEncodingPathWithoutPriorDecoding; 86 | - (NSString *)aws_md5String; 87 | - (NSString *)aws_md5StringLittleEndian; 88 | - (BOOL)aws_isVirtualHostedStyleCompliant; 89 | 90 | - (AWSRegionType)aws_regionTypeValue; 91 | 92 | @end 93 | 94 | @interface NSFileManager (AWS) 95 | 96 | - (BOOL)aws_atomicallyCopyItemAtURL:(NSURL *)sourceURL 97 | toURL:(NSURL *)destinationURL 98 | backupItemName:(NSString *)backupItemName 99 | error:(NSError **)outError; 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Utility/AWSLogging.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | #define AWSLogFormat @"%@ line:%d | %s | " 19 | 20 | #define AWSLogError(fmt, ...) [[AWSLogger defaultLogger] log:AWSLogLevelError format:(AWSLogFormat fmt), [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__] 21 | #define AWSLogWarn(fmt, ...) [[AWSLogger defaultLogger] log:AWSLogLevelWarn format:(AWSLogFormat fmt), [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__] 22 | #define AWSLogInfo(fmt, ...) [[AWSLogger defaultLogger] log:AWSLogLevelInfo format:(AWSLogFormat fmt), [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__] 23 | #define AWSLogDebug(fmt, ...) [[AWSLogger defaultLogger] log:AWSLogLevelDebug format:(AWSLogFormat fmt), [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__] 24 | #define AWSLogVerbose(fmt, ...) [[AWSLogger defaultLogger] log:AWSLogLevelVerbose format:(AWSLogFormat fmt), [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__] 25 | 26 | typedef NS_ENUM(NSInteger, AWSLogLevel) { 27 | AWSLogLevelUnknown = -1, 28 | AWSLogLevelNone = 0, 29 | AWSLogLevelError = 1, 30 | AWSLogLevelWarn = 2, 31 | AWSLogLevelInfo = 3, 32 | AWSLogLevelDebug = 4, 33 | AWSLogLevelVerbose = 5 34 | }; 35 | 36 | /** 37 | `AWSLogger` is an utility class that handles logging to the console. Changing log levels during development may make debugging easier. You can change the log level by importing `AWSCore.h` and calling: 38 | 39 | *Swift* 40 | 41 | AWSLogger.defaultLogger().logLevel = .None 42 | 43 | The following logging level options are available: 44 | 45 | .None 46 | .Error 47 | .Warn 48 | .Info 49 | .Debug (This is the default.) 50 | .Verbose 51 | 52 | *Objective-C* 53 | 54 | [AWSLogger defaultLogger].logLevel = AWSLogLevelNone; 55 | 56 | The following logging level options are available: 57 | 58 | AWSLogLevelNone 59 | AWSLogLevelError 60 | AWSLogLevelWarn 61 | AWSLogLevelInfo 62 | AWSLogLevelDebug (This is the default.) 63 | AWSLogLevelVerbose 64 | 65 | @note We recommend setting the log level to `None` before publishing to the Apple App Store. 66 | */ 67 | __attribute__((deprecated("use AWSDDLog instead"))) 68 | @interface AWSLogger : NSObject 69 | 70 | /** 71 | The log level setting. The default value is `Debug`. 72 | */ 73 | @property (atomic, assign) AWSLogLevel logLevel; 74 | 75 | /** 76 | Returns the shared logger object. 77 | 78 | @return The shared logger object. 79 | */ 80 | + (instancetype)defaultLogger; 81 | 82 | /** 83 | Prints out the formatted logs to the console. You can use the following predefined shorthand methods instead: 84 | 85 | AWSLogError(fmt, ...) 86 | AWSLogWarn(fmt, ...) 87 | AWSLogInfo(fmt, ...) 88 | AWSLogDebug(fmt, ...) 89 | AWSLogVerbose(fmt, ...) 90 | 91 | @param logLevel The level of this log. 92 | @param fmt The formatted string to log. 93 | */ 94 | - (void)log:(AWSLogLevel)logLevel 95 | format:(NSString *)fmt, ... NS_FORMAT_FUNCTION(2, 3); 96 | 97 | @end 98 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Utility/AWSLogging.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import "AWSLogging.h" 17 | #import "AWSService.h" 18 | 19 | #pragma clang diagnostic push 20 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" 21 | 22 | @implementation AWSLogger 23 | 24 | - (instancetype)init { 25 | if (self = [super init]) { 26 | _logLevel = AWSLogLevelDebug; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | + (instancetype)defaultLogger { 33 | static AWSLogger *_defaultLogger = nil; 34 | static dispatch_once_t onceToken; 35 | dispatch_once(&onceToken, ^{ 36 | _defaultLogger = [AWSLogger new]; 37 | }); 38 | 39 | return _defaultLogger; 40 | } 41 | 42 | - (void)log:(AWSLogLevel)logLevel format:(NSString *)fmt, ... NS_FORMAT_FUNCTION(2, 3) { 43 | if(self.logLevel >= logLevel) { 44 | va_list args; 45 | va_start(args, fmt); 46 | NSLog(@"AWSiOSSDK v%@ [%@] %@", AWSiOSSDKVersion, [self logLevelLabel:logLevel], [[NSString alloc] initWithFormat:fmt arguments:args]); 47 | va_end(args); 48 | } 49 | } 50 | 51 | - (NSString *)logLevelLabel:(AWSLogLevel)logLevel { 52 | switch (logLevel) { 53 | case AWSLogLevelError: 54 | return @"Error"; 55 | 56 | case AWSLogLevelWarn: 57 | return @"Warn"; 58 | 59 | case AWSLogLevelInfo: 60 | return @"Info"; 61 | 62 | case AWSLogLevelDebug: 63 | return @"Debug"; 64 | 65 | case AWSLogLevelVerbose: 66 | return @"Verbose"; 67 | 68 | case AWSLogLevelUnknown: 69 | case AWSLogLevelNone: 70 | default: 71 | return @"?"; 72 | } 73 | } 74 | 75 | @end 76 | #pragma clang diagnostic pop 77 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Utility/AWSModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import "AWSMantle.h" 17 | 18 | @interface AWSModel : AWSMTLModel 19 | 20 | @end 21 | 22 | @interface AWSModelUtility : NSObject 23 | 24 | + (NSDictionary *)mapMTLDictionaryFromJSONArrayDictionary:(NSDictionary *)JSONArrayDictionary 25 | arrayElementType:(NSString *)arrayElementType 26 | withModelClass:(Class)modelClass; 27 | + (NSDictionary *)JSONArrayDictionaryFromMapMTLDictionary:(NSDictionary *)mapMTLDictionary 28 | arrayElementType:(NSString *)arrayElementType; 29 | 30 | + (NSArray *)mapMTLArrayFromJSONArray:(NSArray *)JSONArray 31 | withModelClass:(Class)modelClass; 32 | + (NSArray *)JSONArrayFromMapMTLArray:(NSArray *)mapMTLArray; 33 | 34 | + (NSDictionary *)mapMTLDictionaryFromJSONDictionary:(NSDictionary *)JSONDictionary 35 | withModelClass:(Class)modelClass; 36 | + (NSDictionary *)JSONDictionaryFromMapMTLDictionary:(NSDictionary *)mapMTLDictionary; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Utility/AWSSynchronizedMutableDictionary.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | @interface AWSSynchronizedMutableDictionary : NSObject 19 | 20 | - (id)objectForKey:(id)aKey; 21 | - (void)removeObjectForKey:(id)aKey; 22 | - (void)removeObject:(id)object; 23 | - (void)setObject:(id)anObject forKey:(id )aKey; 24 | - (NSArray *)allKeys; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/Utility/AWSSynchronizedMutableDictionary.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import "AWSSynchronizedMutableDictionary.h" 17 | 18 | @interface AWSSynchronizedMutableDictionary() 19 | 20 | @property (nonatomic, strong) NSMutableDictionary *dictionary; 21 | @property (nonatomic, strong) dispatch_queue_t dispatchQueue; 22 | 23 | @end 24 | 25 | @implementation AWSSynchronizedMutableDictionary 26 | 27 | - (instancetype)init { 28 | if (self = [super init]) { 29 | _dictionary = [NSMutableDictionary new]; 30 | _dispatchQueue = dispatch_queue_create("com.amazonaws.AWSSynchronizedMutableDictionary", DISPATCH_QUEUE_SERIAL); 31 | } 32 | 33 | return self; 34 | } 35 | 36 | - (id)objectForKey:(id)aKey { 37 | __block id returnObject = nil; 38 | 39 | dispatch_sync(self.dispatchQueue, ^{ 40 | returnObject = [self.dictionary objectForKey:aKey]; 41 | }); 42 | 43 | return returnObject; 44 | } 45 | 46 | - (void)removeObjectForKey:(id)aKey { 47 | dispatch_sync(self.dispatchQueue, ^{ 48 | [self.dictionary removeObjectForKey:aKey]; 49 | }); 50 | } 51 | 52 | - (void)setObject:(id)anObject forKey:(id )aKey { 53 | dispatch_sync(self.dispatchQueue, ^{ 54 | [self.dictionary setObject:anObject forKey:aKey]; 55 | }); 56 | } 57 | 58 | - (NSArray *)allKeys { 59 | __block NSArray *allKeys = nil; 60 | dispatch_sync(self.dispatchQueue, ^{ 61 | allKeys = [self.dictionary allKeys]; 62 | }); 63 | return allKeys; 64 | } 65 | 66 | - (void)removeObject:(id)object { 67 | dispatch_sync(self.dispatchQueue, ^{ 68 | for (NSString *key in self.dictionary) { 69 | if (object == self.dictionary[key]) { 70 | [self.dictionary removeObjectForKey:key]; 71 | break; 72 | } 73 | } 74 | }); 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /Pods/AWSCore/AWSCore/XMLDictionary/AWSXMLDictionary.h: -------------------------------------------------------------------------------- 1 | // 2 | // XMLDictionary.h 3 | // 4 | // Version 1.4 5 | // 6 | // Created by Nick Lockwood on 15/11/2010. 7 | // Copyright 2010 Charcoal Design. All rights reserved. 8 | // 9 | // Get the latest version of XMLDictionary from here: 10 | // 11 | // https://github.com/nicklockwood/XMLDictionary 12 | // 13 | // This software is provided 'as-is', without any express or implied 14 | // warranty. In no event will the authors be held liable for any damages 15 | // arising from the use of this software. 16 | // 17 | // Permission is granted to anyone to use this software for any purpose, 18 | // including commercial applications, and to alter it and redistribute it 19 | // freely, subject to the following restrictions: 20 | // 21 | // 1. The origin of this software must not be misrepresented; you must not 22 | // claim that you wrote the original software. If you use this software 23 | // in a product, an acknowledgment in the product documentation would be 24 | // appreciated but is not required. 25 | // 26 | // 2. Altered source versions must be plainly marked as such, and must not be 27 | // misrepresented as being the original software. 28 | // 29 | // 3. This notice may not be removed or altered from any source distribution. 30 | // 31 | 32 | #import 33 | #pragma GCC diagnostic push 34 | #pragma GCC diagnostic ignored "-Wobjc-missing-property-synthesis" 35 | 36 | 37 | typedef NS_ENUM(NSInteger, AWSXMLDictionaryAttributesMode) 38 | { 39 | AWSXMLDictionaryAttributesModePrefixed = 0, //default 40 | AWSXMLDictionaryAttributesModeDictionary, 41 | AWSXMLDictionaryAttributesModeUnprefixed, 42 | AWSXMLDictionaryAttributesModeDiscard 43 | }; 44 | 45 | 46 | typedef NS_ENUM(NSInteger, AWSXMLDictionaryNodeNameMode) 47 | { 48 | AWSXMLDictionaryNodeNameModeRootOnly = 0, //default 49 | AWSXMLDictionaryNodeNameModeAlways, 50 | AWSXMLDictionaryNodeNameModeNever 51 | }; 52 | 53 | 54 | static NSString *const AWSXMLDictionaryAttributesKey = @"__attributes"; 55 | static NSString *const AWSXMLDictionaryCommentsKey = @"__comments"; 56 | static NSString *const AWSXMLDictionaryTextKey = @"__text"; 57 | static NSString *const AWSXMLDictionaryNodeNameKey = @"__name"; 58 | static NSString *const AWSXMLDictionaryAttributePrefix = @"_"; 59 | 60 | 61 | @interface AWSXMLDictionaryParser : NSObject 62 | 63 | + (AWSXMLDictionaryParser *)sharedInstance; 64 | 65 | @property (nonatomic, assign) BOOL collapseTextNodes; // defaults to YES 66 | @property (nonatomic, assign) BOOL stripEmptyNodes; // defaults to YES 67 | @property (nonatomic, assign) BOOL trimWhiteSpace; // defaults to YES 68 | @property (nonatomic, assign) BOOL alwaysUseArrays; // defaults to NO 69 | @property (nonatomic, assign) BOOL preserveComments; // defaults to NO 70 | @property (nonatomic, assign) BOOL wrapRootNode; // defaults to NO 71 | 72 | @property (nonatomic, assign) AWSXMLDictionaryAttributesMode attributesMode; 73 | @property (nonatomic, assign) AWSXMLDictionaryNodeNameMode nodeNameMode; 74 | 75 | - (NSDictionary *)dictionaryWithParser:(NSXMLParser *)parser; 76 | - (NSDictionary *)dictionaryWithData:(NSData *)data; 77 | - (NSDictionary *)dictionaryWithString:(NSString *)string; 78 | - (NSDictionary *)dictionaryWithFile:(NSString *)path; 79 | 80 | @end 81 | 82 | 83 | @interface NSDictionary (AWSXMLDictionary) 84 | 85 | + (NSDictionary *)awsxml_dictionaryWithXMLParser:(NSXMLParser *)parser; 86 | + (NSDictionary *)awsxml_dictionaryWithXMLData:(NSData *)data; 87 | + (NSDictionary *)awsxml_dictionaryWithXMLString:(NSString *)string; 88 | + (NSDictionary *)awsxml_dictionaryWithXMLFile:(NSString *)path; 89 | 90 | - (NSDictionary *)awsxml_attributes; 91 | - (NSDictionary *)awsxml_childNodes; 92 | - (NSArray *)awsxml_comments; 93 | - (NSString *)awsxml_nodeName; 94 | - (NSString *)awsxml_innerText; 95 | - (NSString *)awsxml_innerXML; 96 | - (NSString *)awsxml_XMLString; 97 | 98 | - (NSArray *)awsxml_arrayValueForKeyPath:(NSString *)keyPath; 99 | - (NSString *)awsxml_stringValueForKeyPath:(NSString *)keyPath; 100 | - (NSDictionary *)awsxml_dictionaryValueForKeyPath:(NSString *)keyPath; 101 | 102 | @end 103 | 104 | 105 | @interface NSString (AWSXMLDictionary) 106 | 107 | - (NSString *)awsxml_XMLEncodedString; 108 | 109 | @end 110 | 111 | 112 | #pragma GCC diagnostic pop 113 | -------------------------------------------------------------------------------- /Pods/AWSCore/LICENSE: -------------------------------------------------------------------------------- 1 | The AWS Mobile SDK for iOS is generally licensed under the Apache 2.0 License, with the Amazon Cognito Identity Provider and Amazon Cognito Sync subcomponents being licensed under the Amazon Software License and the AWSLex/Bluefront folder under the AWS Customer Agreement (https://aws.amazon.com/agreement/ ). 2 | -------------------------------------------------------------------------------- /Pods/AWSCore/LICENSE.AMAZON: -------------------------------------------------------------------------------- 1 | Amazon Software License 2 | This Amazon Software License (“License”) governs your use, reproduction, and distribution of the accompanying software as specified below. 3 | 1. Definitions 4 | “Licensor” means any person or entity that distributes its Work. 5 | 6 | “Software” means the original work of authorship made available under this License. 7 | 8 | “Work” means the Software and any additions to or derivative works of the Software that are made available under this License. 9 | 10 | The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the meaning as provided under U.S. copyright law; provided, however, that for the purposes of this License, derivative works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work. 11 | 12 | Works, including the Software, are “made available” under this License by including in or with the Work either (a) a copyright notice referencing the applicability of this License to the Work, or (b) a copy of this License. 13 | 2. License Grants 14 | 2.1 Copyright Grant. Subject to the terms and conditions of this License, each Licensor grants to you a perpetual, worldwide, non-exclusive, royalty-free, copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense and distribute its Work and any resulting derivative works in any form. 15 | 2.2 Patent Grant. Subject to the terms and conditions of this License, each Licensor grants to you a perpetual, worldwide, non-exclusive, royalty-free patent license to make, have made, use, sell, offer for sale, import, and otherwise transfer its Work, in whole or in part. The foregoing license applies only to the patent claims licensable by Licensor that would be infringed by Licensor’s Work (or portion thereof) individually and excluding any combinations with any other materials or technology. 16 | 3. Limitations 17 | 3.1 Redistribution. You may reproduce or distribute the Work only if (a) you do so under this License, (b) you include a complete copy of this License with your distribution, and (c) you retain without modification any copyright, patent, trademark, or attribution notices that are present in the Work. 18 | 3.2 Derivative Works. You may specify that additional or different terms apply to the use, reproduction, and distribution of your derivative works of the Work (“Your Terms”) only if (a) Your Terms provide that the use limitation in Section 3.3 applies to your derivative works, and (b) you identify the specific derivative works that are subject to Your Terms. Notwithstanding Your Terms, this License (including the redistribution requirements in Section 3.1) will continue to apply to the Work itself. 19 | 3.3 Use Limitation. The Work and any derivative works thereof only may be used or intended for use with the web services, computing platforms or applications provided by Amazon.com, Inc. or its affiliates, including Amazon Web Services, Inc. 20 | 3.4 Patent Claims. If you bring or threaten to bring a patent claim against any Licensor (including any claim, cross-claim or counterclaim in a lawsuit) to enforce any patents that you allege are infringed by any Work, then your rights under this License from such Licensor (including the grants in Sections 2.1 and 2.2) will terminate immediately. 21 | 3.5 Trademarks. This License does not grant any rights to use any Licensor’s or its affiliates’ names, logos, or trademarks, except as necessary to reproduce the notices described in this License. 22 | 3.6 Termination. If you violate any term of this License, then your rights under this License (including the grants in Sections 2.1 and 2.2) will terminate immediately. 23 | 4. Disclaimer of Warranty. 24 | THE WORK IS PROVIDED “AS IS” WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF M ERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER THIS LICENSE. SOME STATES’ CONSUMER LAWS DO NOT ALLOW EXCLUSION OF AN IMPLIED WARRANTY, SO THIS DISCLAIMER MAY NOT APPLY TO YOU. 25 | 5. Limitation of Liability. 26 | EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK (INCLUDING BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION, LOST PROFITS OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER COMM ERCIAL DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 27 | Effective Date – April 18, 2008 © 2008 Amazon.com, Inc. or its affiliates. All rights reserved. -------------------------------------------------------------------------------- /Pods/AWSS3/AWSS3/AWSS3.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | //! Project version number for AWSS3. 19 | FOUNDATION_EXPORT double AWSS3VersionNumber; 20 | 21 | //! Project version string for AWSS3. 22 | FOUNDATION_EXPORT const unsigned char AWSS3VersionString[]; 23 | 24 | #import 25 | #import "AWSS3Service.h" 26 | #import "AWSS3TransferManager.h" 27 | #import "AWSS3PreSignedURL.h" 28 | #import "AWSS3TransferUtility.h" 29 | -------------------------------------------------------------------------------- /Pods/AWSS3/AWSS3/AWSS3RequestRetryHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | @interface AWSS3RequestRetryHandler : AWSURLRequestRetryHandler 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/AWSS3/AWSS3/AWSS3RequestRetryHandler.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import "AWSS3RequestRetryHandler.h" 17 | #import "AWSService.h" 18 | 19 | @implementation AWSS3RequestRetryHandler 20 | 21 | - (AWSNetworkingRetryType)shouldRetry:(uint32_t)currentRetryCount 22 | originalRequest:(AWSNetworkingRequest *)originalRequest 23 | response:(NSHTTPURLResponse *)response 24 | data:(NSData *)data 25 | error:(NSError *)error { 26 | AWSNetworkingRetryType retryType = [super shouldRetry:currentRetryCount 27 | originalRequest:(AWSNetworkingRequest *)originalRequest 28 | response:response 29 | data:data 30 | error:error]; 31 | if(retryType == AWSNetworkingRetryTypeShouldNotRetry 32 | && currentRetryCount < self.maxRetryCount) { 33 | if (response.statusCode == 200 34 | && error 35 | && error.code != NSURLErrorCancelled) { 36 | retryType = AWSNetworkingRetryTypeShouldRetry; 37 | } 38 | } 39 | 40 | if (currentRetryCount < self.maxRetryCount 41 | && [error.domain isEqualToString:AWSServiceErrorDomain]) { 42 | switch (error.code) { 43 | case AWSServiceErrorSignatureDoesNotMatch: 44 | //may happened right after generating AWS temporary credentials due to the massively distributed nature of Amazon S3, just retry the request 45 | retryType = AWSNetworkingRetryTypeShouldRetry; 46 | break; 47 | 48 | default: 49 | break; 50 | } 51 | } 52 | 53 | return retryType; 54 | } 55 | @end 56 | 57 | -------------------------------------------------------------------------------- /Pods/AWSS3/AWSS3/AWSS3Resources.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | 18 | @interface AWSS3Resources : NSObject 19 | 20 | + (instancetype)sharedInstance; 21 | 22 | - (NSDictionary *)JSONObject; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/AWSS3/AWSS3/AWSS3Serializer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // A copy of the License is located at 7 | // 8 | // http://aws.amazon.com/apache2.0 9 | // 10 | // or in the "license" file accompanying this file. This file is distributed 11 | // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | // express or implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | // 15 | 16 | #import 17 | #import 18 | 19 | @interface AWSS3RequestSerializer : NSObject 20 | 21 | - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition 22 | actionName:(NSString *)actionName; 23 | 24 | @end 25 | 26 | @interface AWSS3ResponseSerializer : NSObject 27 | 28 | @property (nonatomic, assign) Class outputClass; 29 | 30 | - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition 31 | actionName:(NSString *)actionName 32 | outputClass:(Class)outputClass; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Pods/AWSS3/LICENSE: -------------------------------------------------------------------------------- 1 | The AWS Mobile SDK for iOS is generally licensed under the Apache 2.0 License, with the Amazon Cognito Identity Provider and Amazon Cognito Sync subcomponents being licensed under the Amazon Software License and the AWSLex/Bluefront folder under the AWS Customer Agreement (https://aws.amazon.com/agreement/ ). 2 | -------------------------------------------------------------------------------- /Pods/AWSS3/LICENSE.AMAZON: -------------------------------------------------------------------------------- 1 | Amazon Software License 2 | This Amazon Software License (“License”) governs your use, reproduction, and distribution of the accompanying software as specified below. 3 | 1. Definitions 4 | “Licensor” means any person or entity that distributes its Work. 5 | 6 | “Software” means the original work of authorship made available under this License. 7 | 8 | “Work” means the Software and any additions to or derivative works of the Software that are made available under this License. 9 | 10 | The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the meaning as provided under U.S. copyright law; provided, however, that for the purposes of this License, derivative works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work. 11 | 12 | Works, including the Software, are “made available” under this License by including in or with the Work either (a) a copyright notice referencing the applicability of this License to the Work, or (b) a copy of this License. 13 | 2. License Grants 14 | 2.1 Copyright Grant. Subject to the terms and conditions of this License, each Licensor grants to you a perpetual, worldwide, non-exclusive, royalty-free, copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense and distribute its Work and any resulting derivative works in any form. 15 | 2.2 Patent Grant. Subject to the terms and conditions of this License, each Licensor grants to you a perpetual, worldwide, non-exclusive, royalty-free patent license to make, have made, use, sell, offer for sale, import, and otherwise transfer its Work, in whole or in part. The foregoing license applies only to the patent claims licensable by Licensor that would be infringed by Licensor’s Work (or portion thereof) individually and excluding any combinations with any other materials or technology. 16 | 3. Limitations 17 | 3.1 Redistribution. You may reproduce or distribute the Work only if (a) you do so under this License, (b) you include a complete copy of this License with your distribution, and (c) you retain without modification any copyright, patent, trademark, or attribution notices that are present in the Work. 18 | 3.2 Derivative Works. You may specify that additional or different terms apply to the use, reproduction, and distribution of your derivative works of the Work (“Your Terms”) only if (a) Your Terms provide that the use limitation in Section 3.3 applies to your derivative works, and (b) you identify the specific derivative works that are subject to Your Terms. Notwithstanding Your Terms, this License (including the redistribution requirements in Section 3.1) will continue to apply to the Work itself. 19 | 3.3 Use Limitation. The Work and any derivative works thereof only may be used or intended for use with the web services, computing platforms or applications provided by Amazon.com, Inc. or its affiliates, including Amazon Web Services, Inc. 20 | 3.4 Patent Claims. If you bring or threaten to bring a patent claim against any Licensor (including any claim, cross-claim or counterclaim in a lawsuit) to enforce any patents that you allege are infringed by any Work, then your rights under this License from such Licensor (including the grants in Sections 2.1 and 2.2) will terminate immediately. 21 | 3.5 Trademarks. This License does not grant any rights to use any Licensor’s or its affiliates’ names, logos, or trademarks, except as necessary to reproduce the notices described in this License. 22 | 3.6 Termination. If you violate any term of this License, then your rights under this License (including the grants in Sections 2.1 and 2.2) will terminate immediately. 23 | 4. Disclaimer of Warranty. 24 | THE WORK IS PROVIDED “AS IS” WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF M ERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER THIS LICENSE. SOME STATES’ CONSUMER LAWS DO NOT ALLOW EXCLUSION OF AN IMPLIED WARRANTY, SO THIS DISCLAIMER MAY NOT APPLY TO YOU. 25 | 5. Limitation of Liability. 26 | EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK (INCLUDING BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION, LOST PROFITS OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER COMM ERCIAL DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 27 | Effective Date – April 18, 2008 © 2008 Amazon.com, Inc. or its affiliates. All rights reserved. -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AWSCore (2.6.1) 3 | - AWSS3 (2.6.1): 4 | - AWSCore (= 2.6.1) 5 | 6 | DEPENDENCIES: 7 | - AWSS3 8 | 9 | SPEC CHECKSUMS: 10 | AWSCore: e7d37fa0715def975acf1b0d75556576780088b8 11 | AWSS3: 2e18ede28199a5530955dc1a65434da43dcc4d2c 12 | 13 | PODFILE CHECKSUM: 9994b0fa7d0b4e530aec491c80c2d7fc96f0a0c9 14 | 15 | COCOAPODS: 1.3.1 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSCore/AWSCore-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AWSCore : NSObject 3 | @end 4 | @implementation PodsDummy_AWSCore 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSCore/AWSCore-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSCore/AWSCore-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "AWSCore.h" 14 | #import "AWSCredentialsProvider.h" 15 | #import "AWSIdentityProvider.h" 16 | #import "AWSSignature.h" 17 | #import "AWSBolts.h" 18 | #import "AWSCancellationToken.h" 19 | #import "AWSCancellationTokenRegistration.h" 20 | #import "AWSCancellationTokenSource.h" 21 | #import "AWSExecutor.h" 22 | #import "AWSGeneric.h" 23 | #import "AWSTask.h" 24 | #import "AWSTaskCompletionSource.h" 25 | #import "AWSCognitoIdentity.h" 26 | #import "AWSCognitoIdentityModel.h" 27 | #import "AWSCognitoIdentityResources.h" 28 | #import "AWSCognitoIdentityService.h" 29 | #import "AWSFMDatabase.h" 30 | #import "AWSFMDatabaseAdditions.h" 31 | #import "AWSFMDatabasePool.h" 32 | #import "AWSFMDatabaseQueue.h" 33 | #import "AWSFMDB.h" 34 | #import "AWSFMResultSet.h" 35 | #import "AWSGZIP.h" 36 | #import "AWSKSReachability.h" 37 | #import "AWSCocoaLumberjack.h" 38 | #import "AWSDDAbstractDatabaseLogger.h" 39 | #import "AWSDDASLLogCapture.h" 40 | #import "AWSDDASLLogger.h" 41 | #import "AWSDDAssertMacros.h" 42 | #import "AWSDDFileLogger.h" 43 | #import "AWSDDLegacyMacros.h" 44 | #import "AWSDDLog+LOGV.h" 45 | #import "AWSDDLog.h" 46 | #import "AWSDDLogMacros.h" 47 | #import "AWSDDOSLogger.h" 48 | #import "AWSDDTTYLogger.h" 49 | #import "AWSDDContextFilterLogFormatter.h" 50 | #import "AWSDDDispatchQueueLogFormatter.h" 51 | #import "AWSDDMultiFormatter.h" 52 | #import "AWSMantle.h" 53 | #import "AWSMTLJSONAdapter.h" 54 | #import "AWSMTLManagedObjectAdapter.h" 55 | #import "AWSMTLModel+NSCoding.h" 56 | #import "AWSMTLModel.h" 57 | #import "AWSMTLReflection.h" 58 | #import "AWSMTLValueTransformer.h" 59 | #import "NSArray+AWSMTLManipulationAdditions.h" 60 | #import "NSDictionary+AWSMTLManipulationAdditions.h" 61 | #import "NSError+AWSMTLModelException.h" 62 | #import "NSObject+AWSMTLComparisonAdditions.h" 63 | #import "NSValueTransformer+AWSMTLInversionAdditions.h" 64 | #import "NSValueTransformer+AWSMTLPredefinedTransformerAdditions.h" 65 | #import "AWSNetworking.h" 66 | #import "AWSURLSessionManager.h" 67 | #import "AWSSerialization.h" 68 | #import "AWSURLRequestRetryHandler.h" 69 | #import "AWSURLRequestSerialization.h" 70 | #import "AWSURLResponseSerialization.h" 71 | #import "AWSValidation.h" 72 | #import "AWSClientContext.h" 73 | #import "AWSInfo.h" 74 | #import "AWSService.h" 75 | #import "AWSServiceEnum.h" 76 | #import "AWSSTS.h" 77 | #import "AWSSTSModel.h" 78 | #import "AWSSTSResources.h" 79 | #import "AWSSTSService.h" 80 | #import "AWSTMCache.h" 81 | #import "AWSTMCacheBackgroundTaskManager.h" 82 | #import "AWSTMDiskCache.h" 83 | #import "AWSTMMemoryCache.h" 84 | #import "AWSUICKeyChainStore.h" 85 | #import "AWSCategory.h" 86 | #import "AWSLogging.h" 87 | #import "AWSModel.h" 88 | #import "AWSSynchronizedMutableDictionary.h" 89 | 90 | FOUNDATION_EXPORT double AWSCoreVersionNumber; 91 | FOUNDATION_EXPORT const unsigned char AWSCoreVersionString[]; 92 | 93 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSCore/AWSCore.modulemap: -------------------------------------------------------------------------------- 1 | framework module AWSCore { 2 | umbrella header "AWSCore-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSCore/AWSCore.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AWSCore 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = -l"sqlite3" -l"z" -framework "Foundation" -framework "SystemConfiguration" -framework "UIKit" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AWSCore 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSCore/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.6.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSS3/AWSS3-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AWSS3 : NSObject 3 | @end 4 | @implementation PodsDummy_AWSS3 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSS3/AWSS3-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSS3/AWSS3-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "AWSS3.h" 14 | #import "AWSS3Model.h" 15 | #import "AWSS3PreSignedURL.h" 16 | #import "AWSS3RequestRetryHandler.h" 17 | #import "AWSS3Resources.h" 18 | #import "AWSS3Serializer.h" 19 | #import "AWSS3Service.h" 20 | #import "AWSS3TransferManager.h" 21 | #import "AWSS3TransferUtility.h" 22 | 23 | FOUNDATION_EXPORT double AWSS3VersionNumber; 24 | FOUNDATION_EXPORT const unsigned char AWSS3VersionString[]; 25 | 26 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSS3/AWSS3.modulemap: -------------------------------------------------------------------------------- 1 | framework module AWSS3 { 2 | umbrella header "AWSS3-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSS3/AWSS3.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AWSS3 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AWSCore" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AWSS3 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AWSS3/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.6.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AmazonS3Upload/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AmazonS3Upload/Pods-AmazonS3Upload-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AWSCore 5 | 6 | The AWS Mobile SDK for iOS is generally licensed under the Apache 2.0 License, with the Amazon Cognito Identity Provider and Amazon Cognito Sync subcomponents being licensed under the Amazon Software License and the AWSLex/Bluefront folder under the AWS Customer Agreement (https://aws.amazon.com/agreement/ ). 7 | 8 | 9 | ## AWSS3 10 | 11 | The AWS Mobile SDK for iOS is generally licensed under the Apache 2.0 License, with the Amazon Cognito Identity Provider and Amazon Cognito Sync subcomponents being licensed under the Amazon Software License and the AWSLex/Bluefront folder under the AWS Customer Agreement (https://aws.amazon.com/agreement/ ). 12 | 13 | Generated by CocoaPods - https://cocoapods.org 14 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AmazonS3Upload/Pods-AmazonS3Upload-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The AWS Mobile SDK for iOS is generally licensed under the Apache 2.0 License, with the Amazon Cognito Identity Provider and Amazon Cognito Sync subcomponents being licensed under the Amazon Software License and the AWSLex/Bluefront folder under the AWS Customer Agreement (https://aws.amazon.com/agreement/ ). 18 | 19 | License 20 | Apache License, Version 2.0 21 | Title 22 | AWSCore 23 | Type 24 | PSGroupSpecifier 25 | 26 | 27 | FooterText 28 | The AWS Mobile SDK for iOS is generally licensed under the Apache 2.0 License, with the Amazon Cognito Identity Provider and Amazon Cognito Sync subcomponents being licensed under the Amazon Software License and the AWSLex/Bluefront folder under the AWS Customer Agreement (https://aws.amazon.com/agreement/ ). 29 | 30 | License 31 | Apache License, Version 2.0 32 | Title 33 | AWSS3 34 | Type 35 | PSGroupSpecifier 36 | 37 | 38 | FooterText 39 | Generated by CocoaPods - https://cocoapods.org 40 | Title 41 | 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | StringsTable 47 | Acknowledgements 48 | Title 49 | Acknowledgements 50 | 51 | 52 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AmazonS3Upload/Pods-AmazonS3Upload-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_AmazonS3Upload : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_AmazonS3Upload 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AmazonS3Upload/Pods-AmazonS3Upload-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_AmazonS3UploadVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_AmazonS3UploadVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AmazonS3Upload/Pods-AmazonS3Upload.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AWSCore" "$PODS_CONFIGURATION_BUILD_DIR/AWSS3" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AWSCore/AWSCore.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AWSS3/AWSS3.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "AWSCore" -framework "AWSS3" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AmazonS3Upload/Pods-AmazonS3Upload.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_AmazonS3Upload { 2 | umbrella header "Pods-AmazonS3Upload-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AmazonS3Upload/Pods-AmazonS3Upload.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AWSCore" "$PODS_CONFIGURATION_BUILD_DIR/AWSS3" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AWSCore/AWSCore.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AWSS3/AWSS3.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "AWSCore" -framework "AWSS3" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # How to upload a file to Amazon S3 using Swift 2 | 3 | I would like to share a simple tutorial how to upload a to Amazon S3 in iOS using Swift. Let’s go. 4 | 5 | ![alt tag](https://raw.github.com/maximbilan/Swift-Amazon-S3-Uploading-Tutorial/master/img/img1.png) 6 | 7 | We need to add Amazon S3 framework to your project.
8 | In this example I will do this with helping Cocoapods. 9 | 10 | Create a Podfile: 11 | 12 |
13 | platform :ios, '8.0'
14 | inhibit_all_warnings!
15 | use_frameworks!
16 | target 'AmazonS3Upload' do
17 | pod 'AWSS3'
18 | end
19 | 
20 | 21 | Run the next command from Terminal: 22 | 23 |
24 | pod install
25 | 
26 | 27 | Open the generated workspace. And after that we can implement uploading of files using frameworks from Pods. 28 | 29 | We need to import 2 modules: 30 | 31 |
32 | import AWSS3
33 | import AWSCore
34 | 
35 | 36 | Set up a AWS configuration using your credentials. For example: 37 | 38 |
39 | let accessKey = "..."
40 | let secretKey = "..."
41 | let credentialsProvider = AWSStaticCredentialsProvider(accessKey: accessKey, secretKey: secretKey)
42 | let configuration = AWSServiceConfiguration(region: AWSRegionType.usEast1, credentialsProvider: credentialsProvider)
43 | AWSServiceManager.default().defaultServiceConfiguration = configuration
44 | 
45 | 46 | Create an upload request: 47 | 48 |
49 | let url = ...URL to your file...
50 | let remoteName = "Name of uploaded file"
51 | let S3BucketName = "Name of your bucket on Amazon S3"
52 | let uploadRequest = AWSS3TransferManagerUploadRequest()!
53 | uploadRequest.body = url
54 | uploadRequest.key = remoteName
55 | uploadRequest.bucket = S3BucketName
56 | uploadRequest.contentType = "image/jpeg"
57 | uploadRequest.acl = .publicRead
58 | 
59 | 60 | And upload using AWSS3TransferManager. 61 | 62 |
63 | let transferManager = AWSS3TransferManager.default()
64 | transferManager?.upload(uploadRequest).continue({ (task: AWSTask) -> Any? in
65 |   if let error = task.error {
66 |     print("Upload failed with error: (\(error.localizedDescription))")
67 |   }
68 |   if let exception = task.exception {
69 |     print("Upload failed with exception (\(exception))")
70 |   }
71 |   if task.result != nil {
72 |     let url = AWSS3.default().configuration.endpoint.url
73 |     let publicURL = url?.appendingPathComponent(uploadRequest.bucket!).appendingPathComponent(uploadRequest.key!)
74 |     print("Uploaded to:\(publicURL)")
75 |   }
76 |   return nil
77 | })
78 | 
79 | -------------------------------------------------------------------------------- /img/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximbilan/Swift-Amazon-S3-Uploading-Tutorial/b0401281f206444ad36b2566894f6cfa2d7e761e/img/img1.png --------------------------------------------------------------------------------