Classes

The following classes are available globally.

  • An AWS credentials container class.

    See more

    Declaration

    Objective-C

    @interface AWSCredentials : NSObject <NSCopying>

    Swift

    class AWSCredentials : NSObject, NSCopying
  • Warning

    This credentials provider is intended only for testing purposes. We strongly discourage embedding AWS credentials in your production apps because they can be easily extracted and abused. Consider using AWSCognitoCredentialsProvider.
    See more

    Declaration

    Objective-C

    @interface AWSStaticCredentialsProvider : NSObject <AWSCredentialsProvider>

    Swift

    class AWSStaticCredentialsProvider : NSObject, AWSCredentialsProvider
  • Warning

    This credentials provider is intended only for testing purposes. We strongly discourage embedding AWS credentials in your production apps because they can be easily extracted and abused. Consider using AWSCognitoCredentialsProvider. Simple session credentials with keys and session token.
    See more

    Declaration

    Objective-C

    @interface AWSBasicSessionCredentialsProvider
        : NSObject <AWSCredentialsProvider>

    Swift

    class AWSBasicSessionCredentialsProvider : NSObject, AWSCredentialsProvider
  • Undocumented

    Declaration

    Objective-C

    @interface AWSAnonymousCredentialsProvider : NSObject <AWSCredentialsProvider>
    
    @end

    Swift

    class AWSAnonymousCredentialsProvider : NSObject, AWSCredentialsProvider
  • A credentials provider that uses AWS STS web identity federation.

    See more

    Declaration

    Objective-C

    @interface AWSWebIdentityCredentialsProvider : NSObject <AWSCredentialsProvider>

    Swift

    class AWSWebIdentityCredentialsProvider : NSObject, AWSCredentialsProvider
  • An AWSCredentialsProvider that uses Amazon Cognito to fetch temporary credentials tied to an identity.

    To learn more about Amazon Cognito, please visit https://aws.amazon.com/cognito.

    There are 3 different flows supported by this credentials provider, see factory and init methods for choosing the right one for your use case:

    1. Enhanced flow: Uses Cognito for all operations and only requires an identity pool id to initialize.
    2. Basic flow: Uses Cognito + STS and requires identity pool plus IAM roles
    3. Developer authenticated identities: Uses your own AWSCognitoCredentialsProviderHelper to establish identity + Cognito (and optionally STS) to establish credentials.
    See more

    Declaration

    Objective-C

    @interface AWSCognitoCredentialsProvider : NSObject <AWSCredentialsProvider>

    Swift

    class AWSCognitoCredentialsProvider : NSObject, AWSCredentialsProvider
  • An abstract implementation of the AWSCognitoCredentialsProviderHelper.

    See more

    Declaration

    Objective-C

    @interface AWSAbstractCognitoCredentialsProviderHelper
        : NSObject <AWSCognitoCredentialsProviderHelper>

    Swift

    class AWSAbstractCognitoCredentialsProviderHelper : NSObject, AWSCognitoCredentialsProviderHelperProtocol
  • An abstract implementation of the AWSCognitoCredentialsProviderHelper. Developers should extend this class when they want to implement developer authenticated identities and want to support the basic Amazon Cognito authflow in the same application.

    See more
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSSignatureSignerUtility : NSObject
    
    + (NSData * _Nonnull)sha256HMacWithData:(NSData * _Nullable)data withKey:(NSData * _Nonnull)key;
    + (NSString * _Nonnull)hashString:(NSString * _Nullable)stringToHash;
    /*!
     @warning This function is deprecated and will be removed in an upcoming minor
     version of the SDK. You should use hashData instead.
     @deprecated Use hashData instead.
     */
    + (NSData * _Nonnull)hash:(NSData * _Nullable)dataToHash DEPRECATED_MSG_ATTRIBUTE("Use hashData instead.");
    + (NSData * _Nullable)hashData:(NSData * _Nullable)dataToHash;
    + (NSString * _Nonnull)hexEncode:(NSString * _Nullable)string;
    + (NSString * _Nullable)HMACSign:(NSData * _Nullable)data withKey:(NSString * _Nonnull)key usingAlgorithm:(uint32_t)algorithm;
    
    @end

    Swift

    class AWSSignatureSignerUtility : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSSignatureV4Signer : NSObject <AWSNetworkingRequestInterceptor>
    
    @property (nonatomic, strong, readonly) id<AWSCredentialsProvider> _Nonnull credentialsProvider;
    
    - (instancetype _Nonnull)initWithCredentialsProvider:(id<AWSCredentialsProvider> _Nonnull)credentialsProvider
                                       endpoint:(AWSEndpoint * _Nonnull)endpoint;
    
    /**
     Returns a URL signed using the SigV4 algorithm, using the current date, and including the session token (if any) as
     part of the signed query paramters.
    
     @param credentialsProvider credentials provider to get accessKey, secretKey, and optional sessionKey
     @param httpMethod the HTTP method (e.g., "GET", "POST", etc)
     @param expireDuration when should the signed URL expire
     @param endpoint the endpoint of the service for which the URL is being generated
     @param keyPath the request path
     @param requestHeaders the headers to sign as part of the request
     @param requestParameters the URL parameters to sign
     @param signBody if true and the httpMethod is GET, sign an empty string as part of the signature content
     @return a task containing the signed URL
     */
    + (AWSTask<NSURL *> * _Nonnull)generateQueryStringForSignatureV4WithCredentialProvider:(id<AWSCredentialsProvider> _Nonnull)credentialsProvider
                                                                                httpMethod:(AWSHTTPMethod)httpMethod
                                                                            expireDuration:(int32_t)expireDuration
                                                                                  endpoint:(AWSEndpoint * _Nonnull)endpoint
                                                                                   keyPath:(NSString * _Nullable)keyPath
                                                                            requestHeaders:(NSDictionary<NSString *, NSString *> * _Nullable)requestHeaders
                                                                         requestParameters:(NSDictionary<NSString *, id> * _Nullable)requestParameters
                                                                                  signBody:(BOOL)signBody;
    
    /**
     Returns a URL signed using the SigV4 algorithm.
    
     This method requires both regionName and serviceName, because not all AWS service endpoints have the URL format
     "<service>.<region>.amazonaws.com", so we can't necessarily derive the region and service from the URL.
    
     In addition, the method requires the caller to specify a date to use for the signing. This allows for ease of testing,
     but in practice, callers should use `-[NSDate aws_clockSkewFixedDate]` as this value.
    
     @param request the NSURLRequest to sign
     @param credentialsProvider credentials provider to get accessKey, secretKey, and optional sessionKey
     @param regionName the string representing the AWS region of the endpoint to be signed.
     @param serviceName the name of the AWS service the request is for
     @param date the date of the signed credential
     @param expireDuration the duration in seconds the signed URL will be valid for
     @param signBody if true and the httpMethod is GET, sign an empty string as part of the signature content
     @param signSessionToken if true, include the sessionKey returned by the credentialsProvider in the signed payload.
            If false, appends the X-AMZ-Security-Token to the end of the signed URL request parameters
     @return a task containing the signed URL
     */
    + (AWSTask<NSURL *> * _Nonnull)sigV4SignedURLWithRequest:(NSURLRequest * _Nonnull)request
                                          credentialProvider:(id<AWSCredentialsProvider> _Nonnull)credentialsProvider
                                                  regionName:(NSString * _Nonnull)regionName
                                                 serviceName:(NSString * _Nonnull)serviceName
                                                        date:(NSDate * _Nonnull)date
                                              expireDuration:(int32_t)expireDuration
                                                    signBody:(BOOL)signBody
                                            signSessionToken:(BOOL)signSessionToken;
    
    + (NSString * _Nonnull)getCanonicalizedRequest:(NSString * _Nonnull)method
                                     path:(NSString * _Nonnull)path
                                    query:(NSString * _Nullable)query
                                  headers:(NSDictionary * _Nullable)headers
                            contentSha256:(NSString * _Nullable)contentSha256;
    
    + (NSData * _Nonnull)getV4DerivedKey:(NSString * _Nullable)secret
                           date:(NSString * _Nullable)dateStamp
                         region:(NSString * _Nullable)regionName
                        service:(NSString * _Nullable)serviceName;
    
    + (NSString * _Nonnull)getSignedHeadersString:(NSDictionary * _Nullable)headers;
    
    @end

    Swift

    class AWSSignatureV4Signer : NSObject, AWSNetworkingRequestInterceptorProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSSignatureV2Signer : NSObject <AWSNetworkingRequestInterceptor>
    
    @property (nonatomic, strong, readonly) id<AWSCredentialsProvider> _Nullable credentialsProvider;
    
    + (instancetype _Nonnull)signerWithCredentialsProvider:(id<AWSCredentialsProvider> _Nonnull)credentialsProvider
                                         endpoint:(AWSEndpoint * _Nonnull)endpoint;
    
    - (instancetype _Nonnull)initWithCredentialsProvider:(id<AWSCredentialsProvider> _Nonnull)credentialsProvider
                                       endpoint:(AWSEndpoint * _Nonnull)endpoint;
    
    @end

    Swift

    class AWSSignatureV2Signer : NSObject, AWSNetworkingRequestInterceptorProtocol
  • A subclass of NSInputStream that wraps an input stream and adds signature of chunk data.

    See more

    Declaration

    Objective-C

    @interface AWSS3ChunkedEncodingInputStream : NSInputStream <NSStreamDelegate>

    Swift

    class AWSS3ChunkedEncodingInputStream : InputStream, StreamDelegate
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSCancellationToken : NSObject

    Swift

    class AWSCancellationToken : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSCancellationTokenRegistration : NSObject

    Swift

    class AWSCancellationTokenRegistration : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSCancellationTokenSource : NSObject

    Swift

    class AWSCancellationTokenSource : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSExecutor : NSObject

    Swift

    class AWSExecutor : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSTask<__covariant ResultType> : NSObject

    Swift

    class AWSTask<ResultType> : NSObject where ResultType : AnyObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSTaskCompletionSource<__covariant ResultType> : NSObject

    Swift

    class AWSTaskCompletionSource<ResultType> : NSObject where ResultType : AnyObject
  • A provider representing an Amazon Cognito user pool and its client ID.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityCognitoIdentityProvider : AWSModel

    Swift

    class AWSCognitoIdentityCognitoIdentityProvider : AWSModel
  • Input to the CreateIdentityPool action.

    Required parameters: [IdentityPoolName, AllowUnauthenticatedIdentities]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityCreateIdentityPoolInput : AWSRequest

    Swift

    class AWSCognitoIdentityCreateIdentityPoolInput : AWSRequest
  • Credentials for the provided identity ID.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityCredentials : AWSModel

    Swift

    class AWSCognitoIdentityCredentials : AWSModel
  • Input to the DeleteIdentities action.

    Required parameters: [IdentityIdsToDelete]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityDeleteIdentitiesInput : AWSRequest

    Swift

    class AWSCognitoIdentityDeleteIdentitiesInput : AWSRequest
  • Returned in response to a successful DeleteIdentities operation.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityDeleteIdentitiesResponse : AWSModel

    Swift

    class AWSCognitoIdentityDeleteIdentitiesResponse : AWSModel
  • Input to the DeleteIdentityPool action.

    Required parameters: [IdentityPoolId]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityDeleteIdentityPoolInput : AWSRequest

    Swift

    class AWSCognitoIdentityDeleteIdentityPoolInput : AWSRequest
  • Input to the DescribeIdentity action.

    Required parameters: [IdentityId]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityDescribeIdentityInput : AWSRequest

    Swift

    class AWSCognitoIdentityDescribeIdentityInput : AWSRequest
  • Input to the DescribeIdentityPool action.

    Required parameters: [IdentityPoolId]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityDescribeIdentityPoolInput : AWSRequest

    Swift

    class AWSCognitoIdentityDescribeIdentityPoolInput : AWSRequest
  • Input to the GetCredentialsForIdentity action.

    Required parameters: [IdentityId]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityGetCredentialsForIdentityInput : AWSRequest

    Swift

    class AWSCognitoIdentityGetCredentialsForIdentityInput : AWSRequest
  • Returned in response to a successful GetCredentialsForIdentity operation.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityGetCredentialsForIdentityResponse : AWSModel

    Swift

    class AWSCognitoIdentityGetCredentialsForIdentityResponse : AWSModel
  • Input to the GetId action.

    Required parameters: [IdentityPoolId]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityGetIdInput : AWSRequest

    Swift

    class AWSCognitoIdentityGetIdInput : AWSRequest
  • Returned in response to a GetId request.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityGetIdResponse : AWSModel

    Swift

    class AWSCognitoIdentityGetIdResponse : AWSModel
  • Input to the GetIdentityPoolRoles action.

    Required parameters: [IdentityPoolId]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityGetIdentityPoolRolesInput : AWSRequest

    Swift

    class AWSCognitoIdentityGetIdentityPoolRolesInput : AWSRequest
  • Returned in response to a successful GetIdentityPoolRoles operation.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityGetIdentityPoolRolesResponse : AWSModel

    Swift

    class AWSCognitoIdentityGetIdentityPoolRolesResponse : AWSModel
  • Input to the GetOpenIdTokenForDeveloperIdentity action.

    Required parameters: [IdentityPoolId, Logins]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityGetOpenIdTokenForDeveloperIdentityInput
        : AWSRequest

    Swift

    class AWSCognitoIdentityGetOpenIdTokenForDeveloperIdentityInput : AWSRequest
  • Returned in response to a successful GetOpenIdTokenForDeveloperIdentity request.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityGetOpenIdTokenForDeveloperIdentityResponse
        : AWSModel

    Swift

    class AWSCognitoIdentityGetOpenIdTokenForDeveloperIdentityResponse : AWSModel
  • Input to the GetOpenIdToken action.

    Required parameters: [IdentityId]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityGetOpenIdTokenInput : AWSRequest

    Swift

    class AWSCognitoIdentityGetOpenIdTokenInput : AWSRequest
  • Returned in response to a successful GetOpenIdToken request.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityGetOpenIdTokenResponse : AWSModel

    Swift

    class AWSCognitoIdentityGetOpenIdTokenResponse : AWSModel
  • Declaration

    Objective-C

    @interface AWSCognitoIdentityGetPrincipalTagAttributeMapInput : AWSRequest

    Swift

    class AWSCognitoIdentityGetPrincipalTagAttributeMapInput : AWSRequest
  • Declaration

    Objective-C

    @interface AWSCognitoIdentityGetPrincipalTagAttributeMapResponse : AWSModel

    Swift

    class AWSCognitoIdentityGetPrincipalTagAttributeMapResponse : AWSModel
  • A description of the identity.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityIdentityDescription : AWSModel

    Swift

    class AWSCognitoIdentityIdentityDescription : AWSModel
  • An object representing an Amazon Cognito identity pool.

    Required parameters: [IdentityPoolId, IdentityPoolName, AllowUnauthenticatedIdentities]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityIdentityPool : AWSRequest

    Swift

    class AWSCognitoIdentityIdentityPool : AWSRequest
  • A description of the identity pool.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityIdentityPoolShortDescription : AWSModel

    Swift

    class AWSCognitoIdentityIdentityPoolShortDescription : AWSModel
  • Input to the ListIdentities action.

    Required parameters: [IdentityPoolId, MaxResults]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityListIdentitiesInput : AWSRequest

    Swift

    class AWSCognitoIdentityListIdentitiesInput : AWSRequest
  • The response to a ListIdentities request.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityListIdentitiesResponse : AWSModel

    Swift

    class AWSCognitoIdentityListIdentitiesResponse : AWSModel
  • Input to the ListIdentityPools action.

    Required parameters: [MaxResults]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityListIdentityPoolsInput : AWSRequest

    Swift

    class AWSCognitoIdentityListIdentityPoolsInput : AWSRequest
  • The result of a successful ListIdentityPools action.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityListIdentityPoolsResponse : AWSModel

    Swift

    class AWSCognitoIdentityListIdentityPoolsResponse : AWSModel
  • Declaration

    Objective-C

    @interface AWSCognitoIdentityListTagsForResourceInput : AWSRequest

    Swift

    class AWSCognitoIdentityListTagsForResourceInput : AWSRequest
  • Declaration

    Objective-C

    @interface AWSCognitoIdentityListTagsForResourceResponse : AWSModel

    Swift

    class AWSCognitoIdentityListTagsForResourceResponse : AWSModel
  • Input to the LookupDeveloperIdentityInput action.

    Required parameters: [IdentityPoolId]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityLookupDeveloperIdentityInput : AWSRequest

    Swift

    class AWSCognitoIdentityLookupDeveloperIdentityInput : AWSRequest
  • Returned in response to a successful LookupDeveloperIdentity action.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityLookupDeveloperIdentityResponse : AWSModel

    Swift

    class AWSCognitoIdentityLookupDeveloperIdentityResponse : AWSModel
  • A rule that maps a claim name, a claim value, and a match type to a role ARN.

    Required parameters: [Claim, MatchType, Value, RoleARN]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityMappingRule : AWSModel

    Swift

    class AWSCognitoIdentityMappingRule : AWSModel
  • Input to the MergeDeveloperIdentities action.

    Required parameters: [SourceUserIdentifier, DestinationUserIdentifier, DeveloperProviderName, IdentityPoolId]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityMergeDeveloperIdentitiesInput : AWSRequest

    Swift

    class AWSCognitoIdentityMergeDeveloperIdentitiesInput : AWSRequest
  • Returned in response to a successful MergeDeveloperIdentities action.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityMergeDeveloperIdentitiesResponse : AWSModel

    Swift

    class AWSCognitoIdentityMergeDeveloperIdentitiesResponse : AWSModel
  • A role mapping.

    Required parameters: [Type]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityRoleMapping : AWSModel

    Swift

    class AWSCognitoIdentityRoleMapping : AWSModel
  • A container for rules.

    Required parameters: [Rules]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityRulesConfigurationType : AWSModel

    Swift

    class AWSCognitoIdentityRulesConfigurationType : AWSModel
  • Input to the SetIdentityPoolRoles action.

    Required parameters: [IdentityPoolId, Roles]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentitySetIdentityPoolRolesInput : AWSRequest

    Swift

    class AWSCognitoIdentitySetIdentityPoolRolesInput : AWSRequest
  • Declaration

    Objective-C

    @interface AWSCognitoIdentitySetPrincipalTagAttributeMapInput : AWSRequest

    Swift

    class AWSCognitoIdentitySetPrincipalTagAttributeMapInput : AWSRequest
  • Declaration

    Objective-C

    @interface AWSCognitoIdentitySetPrincipalTagAttributeMapResponse : AWSModel

    Swift

    class AWSCognitoIdentitySetPrincipalTagAttributeMapResponse : AWSModel
  • Declaration

    Objective-C

    @interface AWSCognitoIdentityTagResourceInput : AWSRequest

    Swift

    class AWSCognitoIdentityTagResourceInput : AWSRequest
  • Declaration

    Objective-C

    @interface AWSCognitoIdentityTagResourceResponse : AWSModel

    Swift

    class AWSCognitoIdentityTagResourceResponse : AWSModel
  • Input to the UnlinkDeveloperIdentity action.

    Required parameters: [IdentityId, IdentityPoolId, DeveloperProviderName, DeveloperUserIdentifier]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityUnlinkDeveloperIdentityInput : AWSRequest

    Swift

    class AWSCognitoIdentityUnlinkDeveloperIdentityInput : AWSRequest
  • Input to the UnlinkIdentity action.

    Required parameters: [IdentityId, Logins, LoginsToRemove]

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityUnlinkIdentityInput : AWSRequest

    Swift

    class AWSCognitoIdentityUnlinkIdentityInput : AWSRequest
  • An array of UnprocessedIdentityId objects, each of which contains an ErrorCode and IdentityId.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityUnprocessedIdentityId : AWSModel

    Swift

    class AWSCognitoIdentityUnprocessedIdentityId : AWSModel
  • Declaration

    Objective-C

    @interface AWSCognitoIdentityUntagResourceInput : AWSRequest

    Swift

    class AWSCognitoIdentityUntagResourceInput : AWSRequest
  • Declaration

    Objective-C

    @interface AWSCognitoIdentityUntagResourceResponse : AWSModel

    Swift

    class AWSCognitoIdentityUntagResourceResponse : AWSModel
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentityResources : NSObject
    
    + (instancetype)sharedInstance;
    
    - (NSDictionary *)JSONObject;
    
    @end

    Swift

    class AWSCognitoIdentityResources : NSObject
  • Amazon Cognito Federated Identities

    Amazon Cognito Federated Identities is a web service that delivers scoped temporary credentials to mobile devices and other untrusted environments. It uniquely identifies a device and supplies the user with a consistent identity over the lifetime of an application.

    Using Amazon Cognito Federated Identities, you can enable authentication with one or more third-party identity providers (Facebook, Google, or Login with Amazon) or an Amazon Cognito user pool, and you can also choose to support unauthenticated access from your app. Cognito delivers a unique identifier for each user and acts as an OpenID token provider trusted by AWS Security Token Service (STS) to access temporary, limited-privilege AWS credentials.

    For a description of the authentication flow from the Amazon Cognito Developer Guide see Authentication Flow.

    For more information see Amazon Cognito Federated Identities.

    See more

    Declaration

    Objective-C

    @interface AWSCognitoIdentity : AWSService

    Swift

    class AWSCognitoIdentity : AWSService
  • To perform queries and updates on multiple threads, you’ll want to use FMDatabaseQueue.

    Using a single instance of <FMDatabase> from multiple threads at once is a bad idea. It has always been OK to make a <FMDatabase> object per thread. Just don’t share a single instance across threads, and definitely not across multiple threads at the same time.

    Instead, use FMDatabaseQueue. Here’s how to use it:

    First, make your queue.

    FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:aPath];
    

    Then use it like so:

    [queue inDatabase:^(FMDatabase *db) {
        [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:1]];
        [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:2]];
        [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:3]];
    
        FMResultSet *rs = [db executeQuery:@"select * from foo"];
        while ([rs next]) {
            //…
        }
    }];
    

    An easy way to wrap things up in a transaction can be done like this:

    [queue inTransaction:^(FMDatabase *db, BOOL *rollback) {
        [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:1]];
        [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:2]];
        [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:3]];
    
        if (whoopsSomethingWrongHappened) {
            *rollback = YES;
            return;
        }
        // etc…
        [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:4]];
    }];
    

    FMDatabaseQueue will run the blocks on a serialized queue (hence the name of the class). So if you call FMDatabaseQueue‘s methods from multiple threads at the same time, they will be executed in the order they are received. This way queries and updates won’t step on each other’s toes, and every one is happy.

    ### See also

    • <FMDatabase>

    Warning

    Do not instantiate a single <FMDatabase> object and use it across multiple threads. Use FMDatabaseQueue instead.

    Warning

    The calls to FMDatabaseQueue’s methods are blocking. So even though you are passing along blocks, they will not be run on another thread.

    See more

    Declaration

    Objective-C

    @interface AWSFMDatabaseQueue : NSObject {
      NSString *_path;
      dispatch_queue_t _queue;
      AWSFMDatabase *_db;
      int _openFlags;
    }

    Swift

    class AWSFMDatabaseQueue : NSObject
  • Pool of <FMDatabase> objects.

    ### See also

    • <FMDatabaseQueue>
    • <FMDatabase>

    Warning

    Before using FMDatabasePool, please consider using <FMDatabaseQueue> instead.

    If you really really really know what you’re doing and FMDatabasePool is what you really really need (ie, you’re using a read only database), OK you can use it. But just be careful not to deadlock!

    For an example on deadlocking, search for: ONLY_USE_THE_POOL_IF_YOU_ARE_DOING_READS_OTHERWISE_YOULL_DEADLOCK_USE_FMDATABASEQUEUE_INSTEAD in the main.m file.

    See more

    Declaration

    Objective-C

    @interface AWSFMDatabasePool : NSObject {
      NSString *_path;
      dispatch_queue_t _lockQueue;
      NSMutableArray *_databaseInPool;
      NSMutableArray *_databaseOutPool;
      id _delegate;
      NSUInteger _maximumNumberOfDatabasesToCreate;
      int _openFlags;
    }

    Swift

    class AWSFMDatabasePool : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSFMDatabase : NSObject  {
        
        NSString*           _databasePath;
        BOOL                _logsErrors;
        BOOL                _crashOnErrors;
        BOOL                _traceExecution;
        BOOL                _checkedOut;
        BOOL                _shouldCacheStatements;
        BOOL                _isExecutingStatement;
        BOOL                _inTransaction;
        NSTimeInterval      _maxBusyRetryTimeInterval;
        NSTimeInterval      _startBusyRetryTime;
        
        NSMutableDictionary *_cachedStatements;
        NSMutableSet        *_openResultSets;
        NSMutableSet        *_openFunctions;
    
        NSDateFormatter     *_dateFormat;
    }
    
    ///-----------------
    /// @name Properties
    ///-----------------
    
    /** Whether should trace execution */
    
    @property (atomic, assign) BOOL traceExecution;
    
    /** Whether checked out or not */
    
    @property (atomic, assign) BOOL checkedOut;
    
    /** Crash on errors */
    
    @property (atomic, assign) BOOL crashOnErrors;
    
    /** Logs errors */
    
    @property (atomic, assign) BOOL logsErrors;
    
    /** Dictionary of cached statements */
    
    @property (atomic, retain) NSMutableDictionary *cachedStatements;
    
    ///---------------------
    /// @name Initialization
    ///---------------------
    
    /** Create a `FMDatabase` object.
     
     An `FMDatabase` is created with a path to a SQLite database file.  This path can be one of these three:
    
     1. A file system path.  The file does not have to exist on disk.  If it does not exist, it is created for you.
     2. An empty string (`@""`).  An empty database is created at a temporary location.  This database is deleted with the `FMDatabase` connection is closed.
     3. `nil`.  An in-memory database is created.  This database will be destroyed with the `FMDatabase` connection is closed.
    
     For example, to create/open a database in your Mac OS X `tmp` folder:
    
        FMDatabase *db = [FMDatabase databaseWithPath:@"/tmp/tmp.db"];
    
     Or, in iOS, you might open a database in the app's `Documents` directory:
    
        NSString *docsPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
        NSString *dbPath   = [docsPath stringByAppendingPathComponent:@"test.db"];
        FMDatabase *db     = [FMDatabase databaseWithPath:dbPath];
    
     (For more information on temporary and in-memory databases, read the sqlite documentation on the subject: [http://www.sqlite.org/inmemorydb.html](http://www.sqlite.org/inmemorydb.html))
    
     @param inPath Path of database file
    
     @return `FMDatabase` object if successful; `nil` if failure.
    
     */
    
    + (instancetype)databaseWithPath:(NSString*)inPath;
    
    /** Initialize a `FMDatabase` object.
     
     An `FMDatabase` is created with a path to a SQLite database file.  This path can be one of these three:
    
     1. A file system path.  The file does not have to exist on disk.  If it does not exist, it is created for you.
     2. An empty string (`@""`).  An empty database is created at a temporary location.  This database is deleted with the `FMDatabase` connection is closed.
     3. `nil`.  An in-memory database is created.  This database will be destroyed with the `FMDatabase` connection is closed.
    
     For example, to create/open a database in your Mac OS X `tmp` folder:
    
        FMDatabase *db = [FMDatabase databaseWithPath:@"/tmp/tmp.db"];
    
     Or, in iOS, you might open a database in the app's `Documents` directory:
    
        NSString *docsPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
        NSString *dbPath   = [docsPath stringByAppendingPathComponent:@"test.db"];
        FMDatabase *db     = [FMDatabase databaseWithPath:dbPath];
    
     (For more information on temporary and in-memory databases, read the sqlite documentation on the subject: [http://www.sqlite.org/inmemorydb.html](http://www.sqlite.org/inmemorydb.html))
    
     @param inPath Path of database file
     
     @return `FMDatabase` object if successful; `nil` if failure.
    
     */
    
    - (instancetype)initWithPath:(NSString*)inPath;
    
    
    ///-----------------------------------
    /// @name Opening and closing database
    ///-----------------------------------
    
    /** Opening a new database connection
     
     The database is opened for reading and writing, and is created if it does not already exist.
    
     @return `YES` if successful, `NO` on error.
    
     @see [sqlite3_open()](http://sqlite.org/c3ref/open.html)
     @see openWithFlags:
     @see close
     */
    
    - (BOOL)open;
    
    /** Opening a new database connection with flags and an optional virtual file system (VFS)
    
     @param flags one of the following three values, optionally combined with the `SQLITE_OPEN_NOMUTEX`, `SQLITE_OPEN_FULLMUTEX`, `SQLITE_OPEN_SHAREDCACHE`, `SQLITE_OPEN_PRIVATECACHE`, and/or `SQLITE_OPEN_URI` flags:
    
     `SQLITE_OPEN_READONLY`
    
     The database is opened in read-only mode. If the database does not already exist, an error is returned.
     
     `SQLITE_OPEN_READWRITE`
     
     The database is opened for reading and writing if possible, or reading only if the file is write protected by the operating system. In either case the database must already exist, otherwise an error is returned.
     
     `SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE`
     
     The database is opened for reading and writing, and is created if it does not already exist. This is the behavior that is always used for `open` method.
     
     If vfs is given the value is passed to the vfs parameter of sqlite3_open_v2.
     
     @return `YES` if successful, `NO` on error.
    
     @see [sqlite3_open_v2()](http://sqlite.org/c3ref/open.html)
     @see open
     @see close
     
     @warning Requires SQLite 3.5
     */
    
    - (BOOL)openWithFlags:(int)flags;
    - (BOOL)openWithFlags:(int)flags vfs:(NSString *)vfsName;
    
    /** Closing a database connection
     
     @return `YES` if success, `NO` on error.
     
     @see [sqlite3_close()](http://sqlite.org/c3ref/close.html)
     @see open
     @see openWithFlags:
     */
    
    - (BOOL)close;
    
    /** Test to see if we have a good connection to the database.
     
     This will confirm whether:
     
     - is database open
     - if open, it will try a simple SELECT statement and confirm that it succeeds.
    
     @return `YES` if everything succeeds, `NO` on failure.
     */
    
    - (BOOL)goodConnection;
    
    
    ///----------------------
    /// @name Perform updates
    ///----------------------
    
    /** Execute single update statement
     
     This method executes a single SQL update statement (i.e. any SQL that does not return results, such as `UPDATE`, `INSERT`, or `DELETE`. This method employs [`sqlite3_prepare_v2`](http://sqlite.org/c3ref/prepare.html), [`sqlite3_bind`](http://sqlite.org/c3ref/bind_blob.html) to bind values to `?` placeholders in the SQL with the optional list of parameters, and [`sqlite_step`](http://sqlite.org/c3ref/step.html) to perform the update.
    
     The optional values provided to this method should be objects (e.g. `NSString`, `NSNumber`, `NSNull`, `NSDate`, and `NSData` objects), not fundamental data types (e.g. `int`, `long`, `NSInteger`, etc.). This method automatically handles the aforementioned object types, and all other object types will be interpreted as text values using the object's `description` method.
    
     @param sql The SQL to be performed, with optional `?` placeholders.
     
     @param outErr A reference to the `NSError` pointer to be updated with an auto released `NSError` object if an error if an error occurs. If `nil`, no `NSError` object will be returned.
     
     @param ... Optional parameters to bind to `?` placeholders in the SQL statement. These should be Objective-C objects (e.g. `NSString`, `NSNumber`, etc.), not fundamental C data types (e.g. `int`, `char *`, etc.).
    
     @return `YES` upon success; `NO` upon failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
    
     @see lastError
     @see lastErrorCode
     @see lastErrorMessage
     @see [`sqlite3_bind`](http://sqlite.org/c3ref/bind_blob.html)
     */
    
    - (BOOL)executeUpdate:(NSString*)sql withErrorAndBindings:(NSError**)outErr, ...;
    
    /** Execute single update statement
     
     @see executeUpdate:withErrorAndBindings:
     
     @warning **Deprecated**: Please use `<executeUpdate:withErrorAndBindings>` instead.
     */
    
    - (BOOL)update:(NSString*)sql withErrorAndBindings:(NSError**)outErr, ... __attribute__ ((deprecated));
    
    /** Execute single update statement
    
     This method executes a single SQL update statement (i.e. any SQL that does not return results, such as `UPDATE`, `INSERT`, or `DELETE`. This method employs [`sqlite3_prepare_v2`](http://sqlite.org/c3ref/prepare.html), [`sqlite3_bind`](http://sqlite.org/c3ref/bind_blob.html) to bind values to `?` placeholders in the SQL with the optional list of parameters, and [`sqlite_step`](http://sqlite.org/c3ref/step.html) to perform the update.
    
     The optional values provided to this method should be objects (e.g. `NSString`, `NSNumber`, `NSNull`, `NSDate`, and `NSData` objects), not fundamental data types (e.g. `int`, `long`, `NSInteger`, etc.). This method automatically handles the aforementioned object types, and all other object types will be interpreted as text values using the object's `description` method.
     
     @param sql The SQL to be performed, with optional `?` placeholders.
    
     @param ... Optional parameters to bind to `?` placeholders in the SQL statement. These should be Objective-C objects (e.g. `NSString`, `NSNumber`, etc.), not fundamental C data types (e.g. `int`, `char *`, etc.).
    
     @return `YES` upon success; `NO` upon failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
     
     @see lastError
     @see lastErrorCode
     @see lastErrorMessage
     @see [`sqlite3_bind`](http://sqlite.org/c3ref/bind_blob.html)
     
     @note This technique supports the use of `?` placeholders in the SQL, automatically binding any supplied value parameters to those placeholders. This approach is more robust than techniques that entail using `stringWithFormat` to manually build SQL statements, which can be problematic if the values happened to include any characters that needed to be quoted.
     
     @note If you want to use this from Swift, please note that you must include `FMDatabaseVariadic.swift` in your project. Without that, you cannot use this method directly, and instead have to use methods such as `<executeUpdate:withArgumentsInArray:>`.
     */
    
    - (BOOL)executeUpdate:(NSString*)sql, ...;
    
    /** Execute single update statement
    
     This method executes a single SQL update statement (i.e. any SQL that does not return results, such as `UPDATE`, `INSERT`, or `DELETE`. This method employs [`sqlite3_prepare_v2`](http://sqlite.org/c3ref/prepare.html) and [`sqlite_step`](http://sqlite.org/c3ref/step.html) to perform the update. Unlike the other `executeUpdate` methods, this uses printf-style formatters (e.g. `%s`, `%d`, etc.) to build the SQL. Do not use `?` placeholders in the SQL if you use this method.
    
     @param format The SQL to be performed, with `printf`-style escape sequences.
    
     @param ... Optional parameters to bind to use in conjunction with the `printf`-style escape sequences in the SQL statement.
    
     @return `YES` upon success; `NO` upon failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
    
     @see executeUpdate:
     @see lastError
     @see lastErrorCode
     @see lastErrorMessage
     
     @note This method does not technically perform a traditional printf-style replacement. What this method actually does is replace the printf-style percent sequences with a SQLite `?` placeholder, and then bind values to that placeholder. Thus the following command
    
        [db executeUpdateWithFormat:@"INSERT INTO test (name) VALUES (%@)", @"Gus"];
    
     is actually replacing the `%@` with `?` placeholder, and then performing something equivalent to `<executeUpdate:>`
    
        [db executeUpdate:@"INSERT INTO test (name) VALUES (?)", @"Gus"];
    
     There are two reasons why this distinction is important. First, the printf-style escape sequences can only be used where it is permissible to use a SQLite `?` placeholder. You can use it only for values in SQL statements, but not for table names or column names or any other non-value context. This method also cannot be used in conjunction with `pragma` statements and the like. Second, note the lack of quotation marks in the SQL. The `VALUES` clause was _not_ `VALUES ('%@')` (like you might have to do if you built a SQL statement using `NSString` method `stringWithFormat`), but rather simply `VALUES (%@)`.
     */
    
    - (BOOL)executeUpdateWithFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);
    
    /** Execute single update statement
    
     This method executes a single SQL update statement (i.e. any SQL that does not return results, such as `UPDATE`, `INSERT`, or `DELETE`. This method employs [`sqlite3_prepare_v2`](http://sqlite.org/c3ref/prepare.html) and [`sqlite3_bind`](http://sqlite.org/c3ref/bind_blob.html) binding any `?` placeholders in the SQL with the optional list of parameters.
    
     The optional values provided to this method should be objects (e.g. `NSString`, `NSNumber`, `NSNull`, `NSDate`, and `NSData` objects), not fundamental data types (e.g. `int`, `long`, `NSInteger`, etc.). This method automatically handles the aforementioned object types, and all other object types will be interpreted as text values using the object's `description` method.
    
     @param sql The SQL to be performed, with optional `?` placeholders.
    
     @param arguments A `NSArray` of objects to be used when binding values to the `?` placeholders in the SQL statement.
    
     @return `YES` upon success; `NO` upon failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
    
     @see lastError
     @see lastErrorCode
     @see lastErrorMessage
     */
    
    - (BOOL)executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arguments;
    
    /** Execute single update statement
    
     This method executes a single SQL update statement (i.e. any SQL that does not return results, such as `UPDATE`, `INSERT`, or `DELETE`. This method employs [`sqlite3_prepare_v2`](http://sqlite.org/c3ref/prepare.html) and [`sqlite_step`](http://sqlite.org/c3ref/step.html) to perform the update. Unlike the other `executeUpdate` methods, this uses printf-style formatters (e.g. `%s`, `%d`, etc.) to build the SQL.
    
     The optional values provided to this method should be objects (e.g. `NSString`, `NSNumber`, `NSNull`, `NSDate`, and `NSData` objects), not fundamental data types (e.g. `int`, `long`, `NSInteger`, etc.). This method automatically handles the aforementioned object types, and all other object types will be interpreted as text values using the object's `description` method.
    
     @param sql The SQL to be performed, with optional `?` placeholders.
    
     @param arguments A `NSDictionary` of objects keyed by column names that will be used when binding values to the `?` placeholders in the SQL statement.
    
     @return `YES` upon success; `NO` upon failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
    
     @see lastError
     @see lastErrorCode
     @see lastErrorMessage
    */
    
    - (BOOL)executeUpdate:(NSString*)sql withParameterDictionary:(NSDictionary *)arguments;
    
    
    /** Execute single update statement
    
     This method executes a single SQL update statement (i.e. any SQL that does not return results, such as `UPDATE`, `INSERT`, or `DELETE`. This method employs [`sqlite3_prepare_v2`](http://sqlite.org/c3ref/prepare.html) and [`sqlite_step`](http://sqlite.org/c3ref/step.html) to perform the update. Unlike the other `executeUpdate` methods, this uses printf-style formatters (e.g. `%s`, `%d`, etc.) to build the SQL.
    
     The optional values provided to this method should be objects (e.g. `NSString`, `NSNumber`, `NSNull`, `NSDate`, and `NSData` objects), not fundamental data types (e.g. `int`, `long`, `NSInteger`, etc.). This method automatically handles the aforementioned object types, and all other object types will be interpreted as text values using the object's `description` method.
    
     @param sql The SQL to be performed, with optional `?` placeholders.
    
     @param args A `va_list` of arguments.
    
     @return `YES` upon success; `NO` upon failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
    
     @see lastError
     @see lastErrorCode
     @see lastErrorMessage
     */
    
    - (BOOL)executeUpdate:(NSString*)sql withVAList: (va_list)args;
    
    /** Execute multiple SQL statements
     
     This executes a series of SQL statements that are combined in a single string (e.g. the SQL generated by the `sqlite3` command line `.dump` command). This accepts no value parameters, but rather simply expects a single string with multiple SQL statements, each terminated with a semicolon. This uses `sqlite3_exec`. 
    
     @param  sql  The SQL to be performed
     
     @return      `YES` upon success; `NO` upon failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
    
     @see executeStatements:withResultBlock:
     @see [sqlite3_exec()](http://sqlite.org/c3ref/exec.html)
    
     */
    
    - (BOOL)executeStatements:(NSString *)sql;
    
    /** Execute multiple SQL statements with callback handler
     
     This executes a series of SQL statements that are combined in a single string (e.g. the SQL generated by the `sqlite3` command line `.dump` command). This accepts no value parameters, but rather simply expects a single string with multiple SQL statements, each terminated with a semicolon. This uses `sqlite3_exec`.
    
     @param sql       The SQL to be performed.
     @param block     A block that will be called for any result sets returned by any SQL statements. 
                      Note, if you supply this block, it must return integer value, zero upon success (this would be a good opportunity to use SQLITE_OK),
                      non-zero value upon failure (which will stop the bulk execution of the SQL).  If a statement returns values, the block will be called with the results from the query in NSDictionary *resultsDictionary.
                      This may be `nil` if you don't care to receive any results.
    
     @return          `YES` upon success; `NO` upon failure. If failed, you can call `<lastError>`,
                      `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
     
     @see executeStatements:
     @see [sqlite3_exec()](http://sqlite.org/c3ref/exec.html)
    
     */
    
    - (BOOL)executeStatements:(NSString *)sql withResultBlock:(AWSFMDBExecuteStatementsCallbackBlock)block;
    
    /** Last insert rowid
     
     Each entry in an SQLite table has a unique 64-bit signed integer key called the "rowid". The rowid is always available as an undeclared column named `ROWID`, `OID`, or `_ROWID_` as long as those names are not also used by explicitly declared columns. If the table has a column of type `INTEGER PRIMARY KEY` then that column is another alias for the rowid.
     
     This routine returns the rowid of the most recent successful `INSERT` into the database from the database connection in the first argument. As of SQLite version 3.7.7, this routines records the last insert rowid of both ordinary tables and virtual tables. If no successful `INSERT`s have ever occurred on that database connection, zero is returned.
     
     @return The rowid of the last inserted row.
     
     @see [sqlite3_last_insert_rowid()](http://sqlite.org/c3ref/last_insert_rowid.html)
    
     */
    
    - (long long int)lastInsertRowId;
    
    /** The number of rows changed by prior SQL statement.
     
     This function returns the number of database rows that were changed or inserted or deleted by the most recently completed SQL statement on the database connection specified by the first parameter. Only changes that are directly specified by the INSERT, UPDATE, or DELETE statement are counted.
     
     @return The number of rows changed by prior SQL statement.
     
     @see [sqlite3_changes()](http://sqlite.org/c3ref/changes.html)
     
     */
    
    - (int)changes;
    
    
    ///-------------------------
    /// @name Retrieving results
    ///-------------------------
    
    /** Execute select statement
    
     Executing queries returns an `<FMResultSet>` object if successful, and `nil` upon failure.  Like executing updates, there is a variant that accepts an `NSError **` parameter.  Otherwise you should use the `<lastErrorMessage>` and `<lastErrorMessage>` methods to determine why a query failed.
     
     In order to iterate through the results of your query, you use a `while()` loop.  You also need to "step" (via `<[FMResultSet next]>`) from one record to the other.
     
     This method employs [`sqlite3_bind`](http://sqlite.org/c3ref/bind_blob.html) for any optional value parameters. This  properly escapes any characters that need escape sequences (e.g. quotation marks), which eliminates simple SQL errors as well as protects against SQL injection attacks. This method natively handles `NSString`, `NSNumber`, `NSNull`, `NSDate`, and `NSData` objects. All other object types will be interpreted as text values using the object's `description` method.
    
     @param sql The SELECT statement to be performed, with optional `?` placeholders.
    
     @param ... Optional parameters to bind to `?` placeholders in the SQL statement. These should be Objective-C objects (e.g. `NSString`, `NSNumber`, etc.), not fundamental C data types (e.g. `int`, `char *`, etc.).
    
     @return A `<FMResultSet>` for the result set upon success; `nil` upon failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
     
     @see FMResultSet
     @see [`FMResultSet next`](<[FMResultSet next]>)
     @see [`sqlite3_bind`](http://sqlite.org/c3ref/bind_blob.html)
     
     @note If you want to use this from Swift, please note that you must include `FMDatabaseVariadic.swift` in your project. Without that, you cannot use this method directly, and instead have to use methods such as `<executeQuery:withArgumentsInArray:>`.
     */
    
    - (AWSFMResultSet *)executeQuery:(NSString*)sql, ...;
    
    /** Execute select statement
    
     Executing queries returns an `<FMResultSet>` object if successful, and `nil` upon failure.  Like executing updates, there is a variant that accepts an `NSError **` parameter.  Otherwise you should use the `<lastErrorMessage>` and `<lastErrorMessage>` methods to determine why a query failed.
     
     In order to iterate through the results of your query, you use a `while()` loop.  You also need to "step" (via `<[FMResultSet next]>`) from one record to the other.
     
     @param format The SQL to be performed, with `printf`-style escape sequences.
    
     @param ... Optional parameters to bind to use in conjunction with the `printf`-style escape sequences in the SQL statement.
    
     @return A `<FMResultSet>` for the result set upon success; `nil` upon failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
    
     @see executeQuery:
     @see FMResultSet
     @see [`FMResultSet next`](<[FMResultSet next]>)
    
     @note This method does not technically perform a traditional printf-style replacement. What this method actually does is replace the printf-style percent sequences with a SQLite `?` placeholder, and then bind values to that placeholder. Thus the following command
     
        [db executeQueryWithFormat:@"SELECT * FROM test WHERE name=%@", @"Gus"];
     
     is actually replacing the `%@` with `?` placeholder, and then performing something equivalent to `<executeQuery:>`
     
        [db executeQuery:@"SELECT * FROM test WHERE name=?", @"Gus"];
     
     There are two reasons why this distinction is important. First, the printf-style escape sequences can only be used where it is permissible to use a SQLite `?` placeholder. You can use it only for values in SQL statements, but not for table names or column names or any other non-value context. This method also cannot be used in conjunction with `pragma` statements and the like. Second, note the lack of quotation marks in the SQL. The `WHERE` clause was _not_ `WHERE name='%@'` (like you might have to do if you built a SQL statement using `NSString` method `stringWithFormat`), but rather simply `WHERE name=%@`.
     
     */
    
    - (AWSFMResultSet *)executeQueryWithFormat:(NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
    
    /** Execute select statement
    
     Executing queries returns an `<FMResultSet>` object if successful, and `nil` upon failure.  Like executing updates, there is a variant that accepts an `NSError **` parameter.  Otherwise you should use the `<lastErrorMessage>` and `<lastErrorMessage>` methods to determine why a query failed.
     
     In order to iterate through the results of your query, you use a `while()` loop.  You also need to "step" (via `<[FMResultSet next]>`) from one record to the other.
     
     @param sql The SELECT statement to be performed, with optional `?` placeholders.
    
     @param arguments A `NSArray` of objects to be used when binding values to the `?` placeholders in the SQL statement.
    
     @return A `<FMResultSet>` for the result set upon success; `nil` upon failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
    
     @see FMResultSet
     @see [`FMResultSet next`](<[FMResultSet next]>)
     */
    
    - (AWSFMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray *)arguments;
    
    /** Execute select statement
    
     Executing queries returns an `<FMResultSet>` object if successful, and `nil` upon failure.  Like executing updates, there is a variant that accepts an `NSError **` parameter.  Otherwise you should use the `<lastErrorMessage>` and `<lastErrorMessage>` methods to determine why a query failed.
     
     In order to iterate through the results of your query, you use a `while()` loop.  You also need to "step" (via `<[FMResultSet next]>`) from one record to the other.
     
     @param sql The SELECT statement to be performed, with optional `?` placeholders.
    
     @param arguments A `NSDictionary` of objects keyed by column names that will be used when binding values to the `?` placeholders in the SQL statement.
    
     @return A `<FMResultSet>` for the result set upon success; `nil` upon failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
    
     @see FMResultSet
     @see [`FMResultSet next`](<[FMResultSet next]>)
     */
    
    - (AWSFMResultSet *)executeQuery:(NSString *)sql withParameterDictionary:(NSDictionary *)arguments;
    
    
    // Documentation forthcoming.
    - (AWSFMResultSet *)executeQuery:(NSString*)sql withVAList: (va_list)args;
    
    ///-------------------
    /// @name Transactions
    ///-------------------
    
    /** Begin a transaction
     
     @return `YES` on success; `NO` on failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
     
     @see commit
     @see rollback
     @see beginDeferredTransaction
     @see inTransaction
     */
    
    - (BOOL)beginTransaction;
    
    /** Begin a deferred transaction
     
     @return `YES` on success; `NO` on failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
     
     @see commit
     @see rollback
     @see beginTransaction
     @see inTransaction
     */
    
    - (BOOL)beginDeferredTransaction;
    
    /** Commit a transaction
    
     Commit a transaction that was initiated with either `<beginTransaction>` or with `<beginDeferredTransaction>`.
     
     @return `YES` on success; `NO` on failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
     
     @see beginTransaction
     @see beginDeferredTransaction
     @see rollback
     @see inTransaction
     */
    
    - (BOOL)commit;
    
    /** Rollback a transaction
    
     Rollback a transaction that was initiated with either `<beginTransaction>` or with `<beginDeferredTransaction>`.
    
     @return `YES` on success; `NO` on failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
     
     @see beginTransaction
     @see beginDeferredTransaction
     @see commit
     @see inTransaction
     */
    
    - (BOOL)rollback;
    
    /** Identify whether currently in a transaction or not
     
     @return `YES` if currently within transaction; `NO` if not.
     
     @see beginTransaction
     @see beginDeferredTransaction
     @see commit
     @see rollback
     */
    
    - (BOOL)inTransaction;
    
    
    ///----------------------------------------
    /// @name Cached statements and result sets
    ///----------------------------------------
    
    /** Clear cached statements */
    
    - (void)clearCachedStatements;
    
    /** Close all open result sets */
    
    - (void)closeOpenResultSets;
    
    /** Whether database has any open result sets
     
     @return `YES` if there are open result sets; `NO` if not.
     */
    
    - (BOOL)hasOpenResultSets;
    
    /** Return whether should cache statements or not
     
     @return `YES` if should cache statements; `NO` if not.
     */
    
    - (BOOL)shouldCacheStatements;
    
    /** Set whether should cache statements or not
     
     @param value `YES` if should cache statements; `NO` if not.
     */
    
    - (void)setShouldCacheStatements:(BOOL)value;
    
    
    ///-------------------------
    /// @name Encryption methods
    ///-------------------------
    
    /** Set encryption key.
     
     @param key The key to be used.
    
     @return `YES` if success, `NO` on error.
    
     @see http://www.sqlite-encrypt.com/develop-guide.htm
     
     @warning You need to have purchased the sqlite encryption extensions for this method to work.
     */
    
    - (BOOL)setKey:(NSString*)key;
    
    /** Reset encryption key
    
     @param key The key to be used.
    
     @return `YES` if success, `NO` on error.
    
     @see http://www.sqlite-encrypt.com/develop-guide.htm
    
     @warning You need to have purchased the sqlite encryption extensions for this method to work.
     */
    
    - (BOOL)rekey:(NSString*)key;
    
    /** Set encryption key using `keyData`.
     
     @param keyData The `NSData` to be used.
    
     @return `YES` if success, `NO` on error.
    
     @see http://www.sqlite-encrypt.com/develop-guide.htm
     
     @warning You need to have purchased the sqlite encryption extensions for this method to work.
     */
    
    - (BOOL)setKeyWithData:(NSData *)keyData;
    
    /** Reset encryption key using `keyData`.
    
     @param keyData The `NSData` to be used.
    
     @return `YES` if success, `NO` on error.
    
     @see http://www.sqlite-encrypt.com/develop-guide.htm
    
     @warning You need to have purchased the sqlite encryption extensions for this method to work.
     */
    
    - (BOOL)rekeyWithData:(NSData *)keyData;
    
    
    ///------------------------------
    /// @name General inquiry methods
    ///------------------------------
    
    /** The path of the database file
     
     @return path of database.
     
     */
    
    - (NSString *)databasePath;
    
    /** The underlying SQLite handle 
     
     @return The `sqlite3` pointer.
     
     */
    
    - (void*)sqliteHandle;
    
    
    ///-----------------------------
    /// @name Retrieving error codes
    ///-----------------------------
    
    /** Last error message
     
     Returns the English-language text that describes the most recent failed SQLite API call associated with a database connection. If a prior API call failed but the most recent API call succeeded, this return value is undefined.
    
     @return `NSString` of the last error message.
     
     @see [sqlite3_errmsg()](http://sqlite.org/c3ref/errcode.html)
     @see lastErrorCode
     @see lastError
     
     */
    
    - (NSString*)lastErrorMessage;
    
    /** Last error code
     
     Returns the numeric result code or extended result code for the most recent failed SQLite API call associated with a database connection. If a prior API call failed but the most recent API call succeeded, this return value is undefined.
    
     @return Integer value of the last error code.
    
     @see [sqlite3_errcode()](http://sqlite.org/c3ref/errcode.html)
     @see lastErrorMessage
     @see lastError
    
     */
    
    - (int)lastErrorCode;
    
    /** Had error
    
     @return `YES` if there was an error, `NO` if no error.
     
     @see lastError
     @see lastErrorCode
     @see lastErrorMessage
     
     */
    
    - (BOOL)hadError;
    
    /** Last error
    
     @return `NSError` representing the last error.
     
     @see lastErrorCode
     @see lastErrorMessage
     
     */
    
    - (NSError*)lastError;
    
    
    // description forthcoming
    - (void)setMaxBusyRetryTimeInterval:(NSTimeInterval)timeoutInSeconds;
    - (NSTimeInterval)maxBusyRetryTimeInterval;
    
    
    ///------------------
    /// @name Save points
    ///------------------
    
    /** Start save point
     
     @param name Name of save point.
     
     @param outErr A `NSError` object to receive any error object (if any).
     
     @return `YES` on success; `NO` on failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
     
     @see releaseSavePointWithName:error:
     @see rollbackToSavePointWithName:error:
     */
    
    - (BOOL)startSavePointWithName:(NSString*)name error:(NSError**)outErr;
    
    /** Release save point
    
     @param name Name of save point.
     
     @param outErr A `NSError` object to receive any error object (if any).
     
     @return `YES` on success; `NO` on failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
    
     @see startSavePointWithName:error:
     @see rollbackToSavePointWithName:error:
     
     */
    
    - (BOOL)releaseSavePointWithName:(NSString*)name error:(NSError**)outErr;
    
    /** Roll back to save point
    
     @param name Name of save point.
     @param outErr A `NSError` object to receive any error object (if any).
     
     @return `YES` on success; `NO` on failure. If failed, you can call `<lastError>`, `<lastErrorCode>`, or `<lastErrorMessage>` for diagnostic information regarding the failure.
     
     @see startSavePointWithName:error:
     @see releaseSavePointWithName:error:
     
     */
    
    - (BOOL)rollbackToSavePointWithName:(NSString*)name error:(NSError**)outErr;
    
    /** Start save point
    
     @param block Block of code to perform from within save point.
     
     @return The NSError corresponding to the error, if any. If no error, returns `nil`.
    
     @see startSavePointWithName:error:
     @see releaseSavePointWithName:error:
     @see rollbackToSavePointWithName:error:
     
     */
    
    - (NSError*)inSavePoint:(void (^)(BOOL *rollback))block;
    
    
    ///----------------------------
    /// @name SQLite library status
    ///----------------------------
    
    /** Test to see if the library is threadsafe
    
     @return `NO` if and only if SQLite was compiled with mutexing code omitted due to the SQLITE_THREADSAFE compile-time option being set to 0.
    
     @see [sqlite3_threadsafe()](http://sqlite.org/c3ref/threadsafe.html)
     */
    
    + (BOOL)isSQLiteThreadSafe;
    
    /** Run-time library version numbers
     
     @return The sqlite library version string.
     
     @see [sqlite3_libversion()](http://sqlite.org/c3ref/libversion.html)
     */
    
    + (NSString*)sqliteLibVersion;
    
    
    + (NSString*)AWSFMDBUserVersion;
    
    + (SInt32)AWSFMDBVersion;
    
    
    ///------------------------
    /// @name Make SQL function
    ///------------------------
    
    /** Adds SQL functions or aggregates or to redefine the behavior of existing SQL functions or aggregates.
     
     For example:
     
        [queue inDatabase:^(FMDatabase *adb) {
    
            [adb executeUpdate:@"create table ftest (foo text)"];
            [adb executeUpdate:@"insert into ftest values ('hello')"];
            [adb executeUpdate:@"insert into ftest values ('hi')"];
            [adb executeUpdate:@"insert into ftest values ('not h!')"];
            [adb executeUpdate:@"insert into ftest values ('definitely not h!')"];
    
            [adb makeFunctionNamed:@"StringStartsWithH" maximumArguments:1 withBlock:^(sqlite3_context *context, int aargc, sqlite3_value **aargv) {
                if (sqlite3_value_type(aargv[0]) == SQLITE_TEXT) {
                    @autoreleasepool {
                        const char *c = (const char *)sqlite3_value_text(aargv[0]);
                        NSString *s = [NSString stringWithUTF8String:c];
                        sqlite3_result_int(context, [s hasPrefix:@"h"]);
                    }
                }
                else {
                    NSLog(@"Unknown formart for StringStartsWithH (%d) %s:%d", sqlite3_value_type(aargv[0]), __FUNCTION__, __LINE__);
                    sqlite3_result_null(context);
                }
            }];
    
            int rowCount = 0;
            FMResultSet *ars = [adb executeQuery:@"select * from ftest where StringStartsWithH(foo)"];
            while ([ars next]) {
                rowCount++;
                NSLog(@"Does %@ start with 'h'?", [rs stringForColumnIndex:0]);
            }
            AWSFMDBQuickCheck(rowCount == 2);
        }];
    
     @param name Name of function
    
     @param count Maximum number of parameters
    
     @param block The block of code for the function
    
     @see [sqlite3_create_function()](http://sqlite.org/c3ref/create_function.html)
     */
    
    - (void)makeFunctionNamed:(NSString*)name maximumArguments:(int)count withBlock:(void (^)(void *context, int argc, void **argv))block;
    
    
    ///---------------------
    /// @name Date formatter
    ///---------------------
    
    /** Generate an `NSDateFormatter` that won't be broken by permutations of timezones or locales.
     
     Use this method to generate values to set the dateFormat property.
     
     Example:
    
        myDB.dateFormat = [FMDatabase storeableDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    
     @param format A valid NSDateFormatter format string.
     
     @return A `NSDateFormatter` that can be used for converting dates to strings and vice versa.
     
     @see hasDateFormatter
     @see setDateFormat:
     @see dateFromString:
     @see stringFromDate:
     @see storeableDateFormat:
    
     @warning Note that `NSDateFormatter` is not thread-safe, so the formatter generated by this method should be assigned to only one AWSFMDB instance and should not be used for other purposes.
    
     */
    
    + (NSDateFormatter *)storeableDateFormat:(NSString *)format;
    
    /** Test whether the database has a date formatter assigned.
     
     @return `YES` if there is a date formatter; `NO` if not.
     
     @see hasDateFormatter
     @see setDateFormat:
     @see dateFromString:
     @see stringFromDate:
     @see storeableDateFormat:
     */
    
    - (BOOL)hasDateFormatter;
    
    /** Set to a date formatter to use string dates with sqlite instead of the default UNIX timestamps.
     
     @param format Set to nil to use UNIX timestamps. Defaults to nil. Should be set using a formatter generated using FMDatabase::storeableDateFormat.
     
     @see hasDateFormatter
     @see setDateFormat:
     @see dateFromString:
     @see stringFromDate:
     @see storeableDateFormat:
     
     @warning Note there is no direct getter for the `NSDateFormatter`, and you should not use the formatter you pass to AWSFMDB for other purposes, as `NSDateFormatter` is not thread-safe.
     */
    
    - (void)setDateFormat:(NSDateFormatter *)format;
    
    /** Convert the supplied NSString to NSDate, using the current database formatter.
     
     @param s `NSString` to convert to `NSDate`.
     
     @return The `NSDate` object; or `nil` if no formatter is set.
     
     @see hasDateFormatter
     @see setDateFormat:
     @see dateFromString:
     @see stringFromDate:
     @see storeableDateFormat:
     */
    
    - (NSDate *)dateFromString:(NSString *)s;
    
    /** Convert the supplied NSDate to NSString, using the current database formatter.
     
     @param date `NSDate` of date to convert to `NSString`.
    
     @return The `NSString` representation of the date; `nil` if no formatter is set.
     
     @see hasDateFormatter
     @see setDateFormat:
     @see dateFromString:
     @see stringFromDate:
     @see storeableDateFormat:
     */
    
    - (NSString *)stringFromDate:(NSDate *)date;
    
    @end

    Swift

    class AWSFMDatabase : NSObject
  • Objective-C wrapper for sqlite3_stmt

    This is a wrapper for a SQLite sqlite3_stmt. Generally when using AWSFMDB you will not need to interact directly with FMStatement, but rather with <FMDatabase> and <FMResultSet> only.

    ### See also

    See more

    Declaration

    Objective-C

    @interface AWSFMStatement : NSObject {
      NSString *_query;
      long _useCount;
      BOOL _inUse;
    }

    Swift

    class AWSFMStatement : NSObject
  • Represents the results of executing a query on an <FMDatabase>.

    ### See also

    • <FMDatabase>
    See more

    Declaration

    Objective-C

    @interface AWSFMResultSet : NSObject {
      AWSFMDatabase *_parentDB;
      AWSFMStatement *_statement;
      NSString *_query;
      NSMutableDictionary *_columnNameToIndexMap;
    }

    Swift

    class AWSFMResultSet : NSObject
  • Monitors network connectivity. *

    • You can elect to be notified via blocks (onReachabilityChanged),
    • notifications (notificationName), or KVO (flags, reachable, and WWANOnly). *
    • All notification methods are disabled by default. *

    Note

    Upon construction, this object will fetch its initial reachability
    • state in the background. This means that the reachability status will ALWAYS
    • be “unreachable” until some time after object construction (possibly up to 10
    • seconds, depending on how long the DNS lookup takes). Use the “initialized”
    • property to monitor initialization, or set the callback “onInitializationComplete”.
    See more

    Declaration

    Objective-C

    @interface AWSKSReachability : NSObject

    Swift

    class AWSKSReachability : NSObject
  • A one-time operation to perform as soon as a host is deemed reachable.

    • The operation will only be performed once, regardless of how many times a
    • host becomes reachable.
    See more

    Declaration

    Objective-C

    @interface AWSKSReachableOperation : NSObject

    Swift

    class AWSKSReachableOperation : NSObject
  • This class provides the ability to capture the ASL (Apple System Logs)

    See more

    Declaration

    Objective-C

    
    @interface AWSDDASLLogCapture : NSObject

    Swift

    class AWSDDASLLogCapture : NSObject
  • This class provides a logger for the Apple System Log facility.

    As described in the “Getting Started” page, the traditional NSLog() function directs its output to two places:

    • Apple System Log
    • StdErr (if stderr is a TTY) so log statements show up in Xcode console

    To duplicate NSLog() functionality you can simply add this logger and a tty logger. However, if you instead choose to use file logging (for faster performance), you may choose to use a file logger and a tty logger.

    See more

    Declaration

    Objective-C

    
    @interface AWSDDASLLogger : AWSDDAbstractLogger <AWSDDLogger>

    Swift

    class AWSDDASLLogger : AWSDDAbstractLogger, AWSDDLogger
  • This class provides an abstract implementation of a database logger.

    That is, it provides the base implementation for a database logger to build atop of. All that is needed for a concrete database logger is to extend this class and override the methods in the implementation file that are prefixed with “db_”.

    See more

    Declaration

    Objective-C

    @interface AWSDDAbstractDatabaseLogger : AWSDDAbstractLogger {
      NSUInteger _saveThreshold;
      NSTimeInterval _saveInterval;
      NSTimeInterval _maxAge;
      NSTimeInterval _deleteInterval;
      BOOL _deleteOnEverySave;
      NSInteger _saveTimerSuspended;
      NSUInteger _unsavedCount;
      dispatch_time_t _unsavedTime;
      dispatch_source_t _saveTimer;
      dispatch_time_t _lastDeleteTime;
      dispatch_source_t _deleteTimer;
    }

    Swift

    class AWSDDAbstractDatabaseLogger : AWSDDAbstractLogger
  • The (default) plain text message serializer.

    See more

    Declaration

    Objective-C

    @interface AWSDDFileLogPlainTextMessageSerializer
        : NSObject <AWSDDFileLogMessageSerializer>

    Swift

    class AWSDDFileLogPlainTextMessageSerializer : NSObject, AWSDDFileLogMessageSerializer
  • Default log file manager.

    All log files are placed inside the logsDirectory. If a specific logsDirectory isn’t specified, the default directory is used. On Mac, this is in ~/Library/Logs/<Application Name>. On iPhone, this is in ~/Library/Caches/Logs.

    Log files are named "<bundle identifier> <date> <time>.log" Example: com.organization.myapp 2013-12-03 17-14.log

    Archived log files are automatically deleted according to the maximumNumberOfLogFiles property.

    See more

    Declaration

    Objective-C

    @interface AWSDDLogFileManagerDefault : NSObject <AWSDDLogFileManager>

    Swift

    class AWSDDLogFileManagerDefault : NSObject, AWSDDLogFileManager
  • Most users will want file log messages to be prepended with the date and time. Rather than forcing the majority of users to write their own formatter, we will supply a logical default formatter. Users can easily replace this formatter with their own by invoking the setLogFormatter: method. It can also be removed by calling setLogFormatter:, and passing a nil parameter.

    In addition to the convenience of having a logical default formatter, it will also provide a template that makes it easy for developers to copy and change.

    See more

    Declaration

    Objective-C

    @interface AWSDDLogFileFormatterDefault : NSObject <AWSDDLogFormatter>

    Swift

    class AWSDDLogFileFormatterDefault : NSObject, AWSDDLogFormatter
  • The standard implementation for a file logger

    See more

    Declaration

    Objective-C

    @interface AWSDDFileLogger : AWSDDAbstractLogger <AWSDDLogger>

    Swift

    class AWSDDFileLogger : AWSDDAbstractLogger, AWSDDLogger
  • AWSDDLogFileInfo is a simple class that provides access to various file attributes. It provides good performance as it only fetches the information if requested, and it caches the information to prevent duplicate fetches.

    It was designed to provide quick snapshots of the current state of log files, and to help sort log files in an array.

    This class does not monitor the files, or update it’s cached attribute values if the file changes on disk. This is not what the class was designed for.

    If you absolutely must get updated values, you can invoke the reset method which will clear the cache.

    See more

    Declaration

    Objective-C

    @interface AWSDDLogFileInfo : NSObject

    Swift

    class AWSDDLogFileInfo : NSObject
  • The main class, exposes all logging mechanisms, loggers, … For most of the users, this class is hidden behind the logging functions like AWSDDLogInfo

    See more

    Declaration

    Objective-C

    
    @interface AWSDDLog : NSObject

    Swift

    class AWSDDLog : NSObject, @unchecked Sendable
  • The AWSDDLogMessage class encapsulates information about the log message. If you write custom loggers or formatters, you will be dealing with objects of this class.

    See more

    Declaration

    Objective-C

    
    @interface AWSDDLogMessage : NSObject <NSCopying> {
      NSString *_message;
      NSString *_messageFormat;
      AWSDDLogLevel _level;
      AWSDDLogFlag _flag;
      NSInteger _context;
      NSString *_file;
      NSString *_fileName;
      NSString *_function;
      NSUInteger _line;
      id _tag;
      id _representedObject;
      AWSDDLogMessageOptions _options;
      NSDate *_timestamp;
      NSString *_threadID;
      NSString *_threadName;
      NSString *_queueLabel;
      NSUInteger _qos;
    }

    Swift

    class AWSDDLogMessage : NSObject, NSCopying, @unchecked Sendable
  • The AWSDDLogger protocol specifies that an optional formatter can be added to a logger. Most (but not all) loggers will want to support formatters.

    However, writing getters and setters in a thread safe manner, while still maintaining maximum speed for the logging process, is a difficult task.

    To do it right, the implementation of the getter/setter has strict requirements:

    • Must NOT require the logMessage: method to acquire a lock.
    • Must NOT require the logMessage: method to access an atomic property (also a lock of sorts).

    To simplify things, an abstract logger is provided that implements the getter and setter.

    Logger implementations may simply extend this class, and they can ACCESS THE FORMATTER VARIABLE DIRECTLY from within their logMessage: method!

    See more

    Declaration

    Objective-C

    @interface AWSDDAbstractLogger : NSObject <AWSDDLogger> {
      id<AWSDDLogFormatter> _Nullable _logFormatter;
      dispatch_queue_t _loggerQueue;
    }

    Swift

    class AWSDDAbstractLogger : NSObject, AWSDDLogger
  • /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    See more

    Declaration

    Objective-C

    
    @interface AWSDDLoggerInformation : NSObject

    Swift

    class AWSDDLoggerInformation : NSObject, @unchecked Sendable
  • This class provides a logger for the Apple os_log facility.

    See more

    Declaration

    Objective-C

    
    @interface AWSDDOSLogger : AWSDDAbstractLogger <AWSDDLogger>

    Swift

    class AWSDDOSLogger : AWSDDAbstractLogger, AWSDDLogger, @unchecked Sendable
  • This class provides a logger for Terminal output or Xcode console output, depending on where you are running your code.

    As described in the “Getting Started” page, the traditional NSLog() function directs it’s output to two places:

    • Apple System Log (so it shows up in Console.app)
    • StdErr (if stderr is a TTY, so log statements show up in Xcode console)

    To duplicate NSLog() functionality you can simply add this logger and an asl logger. However, if you instead choose to use file logging (for faster performance), you may choose to use only a file logger and a tty logger.

    See more

    Declaration

    Objective-C

    @interface AWSDDTTYLogger : AWSDDAbstractLogger <AWSDDLogger>

    Swift

    class AWSDDTTYLogger : AWSDDAbstractLogger, AWSDDLogger
  • This class provides a log formatter that filters log statements from a logging context not on the allowlist.

    A log formatter can be added to any logger to format and/or filter its output. You can learn more about log formatters here: Documentation/CustomFormatters.md

    You can learn more about logging context’s here: Documentation/CustomContext.md

    But here’s a quick overview / refresher:

    Every log statement has a logging context. These come from the underlying logging macros defined in AWSDDLog.h. The default logging context is zero. You can define multiple logging context’s for use in your application. For example, logically separate parts of your app each have a different logging context. Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context.

    See more

    Declaration

    Objective-C

    @interface AWSDDContextAllowlistFilterLogFormatter
        : NSObject <AWSDDLogFormatter>

    Swift

    class AWSDDContextAllowlistFilterLogFormatter : NSObject, AWSDDLogFormatter
  • This class provides a log formatter that filters log statements from a logging context on the denylist.

    See more

    Declaration

    Objective-C

    @interface AWSDDContextDenylistFilterLogFormatter : NSObject <AWSDDLogFormatter>

    Swift

    class AWSDDContextDenylistFilterLogFormatter : NSObject, AWSDDLogFormatter
  • This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id.

    A log formatter can be added to any logger to format and/or filter its output. You can learn more about log formatters here: Documentation/CustomFormatters.md

    A typical NSLog (or AWSDDTTYLogger) prints detailed info as [<process_id>:<thread_id>]. For example:

    2011-10-17 20:21:45.435 AppName[19928:5207] Your log message here

    Where: - 19928 = process id - 5207 = thread id (mach_thread_id printed in hex)

    When using grand central dispatch (GCD), this information is less useful. This is because a single serial dispatch queue may be run on any thread from an internally managed thread pool. For example:

    2011-10-17 20:32:31.111 AppName[19954:4d07] Message from my_serial_dispatch_queue 2011-10-17 20:32:31.112 AppName[19954:5207] Message from my_serial_dispatch_queue 2011-10-17 20:32:31.113 AppName[19954:2c55] Message from my_serial_dispatch_queue

    This formatter allows you to replace the standard [box:info] with the dispatch_queue name. For example:

    2011-10-17 20:32:31.111 AppName[img-scaling] Message from my_serial_dispatch_queue 2011-10-17 20:32:31.112 AppName[img-scaling] Message from my_serial_dispatch_queue 2011-10-17 20:32:31.113 AppName[img-scaling] Message from my_serial_dispatch_queue

    If the dispatch_queue doesn’t have a set name, then it falls back to the thread name. If the current thread doesn’t have a set name, then it falls back to the mach_thread_id in hex (like normal).

    Note: If manually creating your own background threads (via NSThread/alloc/init or NSThread/detachNeThread), you can use [[NSThread currentThread] setName:(NSString *)].

    See more

    Declaration

    Objective-C

    @interface AWSDDDispatchQueueLogFormatter : NSObject <AWSDDLogFormatter>

    Swift

    class AWSDDDispatchQueueLogFormatter : NSObject, AWSDDLogFormatter

AWSDDAtomicCountable

  • Deprecated

    AWSDDAtomicCountable is deprecated

    Undocumented

    Declaration

    Objective-C

    @interface AWSDDAtomicCounter: NSObject<AWSDDAtomicCountable>
    @end

    Swift

    class AWSDDAtomicCounter : NSObject, AWSDDAtomicCountable
  • This formatter can be used to chain different formatters together. The log message will processed in the order of the formatters added.

    See more

    Declaration

    Objective-C

    @interface AWSDDMultiFormatter : NSObject <AWSDDLogFormatter>

    Swift

    class AWSDDMultiFormatter : NSObject, AWSDDLogFormatter
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSMTLJSONAdapter : NSObject
    
    // The model object that the receiver was initialized with, or that the receiver
    // parsed from a JSON dictionary.
    @property (nonatomic, strong, readonly) AWSMTLModel<AWSMTLJSONSerializing> *model;
    
    // Attempts to parse a JSON dictionary into a model object.
    //
    // modelClass     - The MTLModel subclass to attempt to parse from the JSON.
    //                  This class must conform to <MTLJSONSerializing>. This
    //                  argument must not be nil.
    // JSONDictionary - A dictionary representing JSON data. This should match the
    //                  format returned by NSJSONSerialization. If this argument is
    //                  nil, the method returns nil.
    // error          - If not NULL, this may be set to an error that occurs during
    //                  parsing or initializing an instance of `modelClass`.
    //
    // Returns an instance of `modelClass` upon success, or nil if a parsing error
    // occurred.
    + (id)modelOfClass:(Class)modelClass fromJSONDictionary:(NSDictionary *)JSONDictionary error:(NSError **)error;
    
    // Attempts to parse an array of JSON dictionary objects into a model objects
    // of a specific class.
    //
    // modelClass - The MTLModel subclass to attempt to parse from the JSON. This
    //              class must conform to <MTLJSONSerializing>. This argument must
    //              not be nil.
    // JSONArray  - A array of dictionaries representing JSON data. This should
    //              match the format returned by NSJSONSerialization. If this
    //              argument is nil, the method returns nil.
    // error      - If not NULL, this may be set to an error that occurs during
    //              parsing or initializing an any of the instances of
    //              `modelClass`.
    //
    // Returns an array of `modelClass` instances upon success, or nil if a parsing
    // error occurred.
    + (NSArray *)modelsOfClass:(Class)modelClass fromJSONArray:(NSArray *)JSONArray error:(NSError **)error;
    
    // Converts a model into a JSON representation.
    //
    // model - The model to use for JSON serialization. This argument must not be
    //         nil.
    //
    // Returns a JSON dictionary, or nil if a serialization error occurred.
    + (NSDictionary *)JSONDictionaryFromModel:(AWSMTLModel<AWSMTLJSONSerializing> *)model;
    
    // Converts a array of models into a JSON representation.
    //
    // models - The array of models to use for JSON serialization. This argument
    //          must not be nil.
    //
    // Returns a JSON array, or nil if a serialization error occurred for any
    // model.
    + (NSArray *)JSONArrayFromModels:(NSArray *)models;
    
    // Initializes the receiver by attempting to parse a JSON dictionary into
    // a model object.
    //
    // JSONDictionary - A dictionary representing JSON data. This should match the
    //                  format returned by NSJSONSerialization. If this argument is
    //                  nil, the method returns nil and an error with code
    //                  MTLJSONAdapterErrorInvalidJSONDictionary.
    // modelClass     - The MTLModel subclass to attempt to parse from the JSON.
    //                  This class must conform to <MTLJSONSerializing>. This
    //                  argument must not be nil.
    // error          - If not NULL, this may be set to an error that occurs during
    //                  parsing or initializing an instance of `modelClass`.
    //
    // Returns an initialized adapter upon success, or nil if a parsing error
    // occurred.
    - (id)initWithJSONDictionary:(NSDictionary *)JSONDictionary modelClass:(Class)modelClass error:(NSError **)error;
    
    // Initializes the receiver with an existing model.
    //
    // model - The model to use for JSON serialization. This argument must not be
    //         nil.
    - (id)initWithModel:(AWSMTLModel<AWSMTLJSONSerializing> *)model;
    
    // Serializes the receiver's `model` into JSON.
    //
    // Returns a JSON dictionary, or nil if a serialization error occurred.
    - (NSDictionary *)JSONDictionary;
    
    // Looks up the JSON key path in the model's +propertyKeys.
    //
    // Subclasses may override this method to customize the adapter's seralizing
    // behavior. You should not call this method directly.
    //
    // key - The property key to retrieve the corresponding JSON key path for. This
    //       argument must not be nil.
    //
    // Returns a key path to use, or nil to omit the property from JSON.
    - (NSString *)JSONKeyPathForPropertyKey:(NSString *)key;
    
    @end

    Swift

    class AWSMTLJSONAdapter : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSMTLManagedObjectAdapter : NSObject
    
    // Attempts to deserialize an NSManagedObject into a MTLModel object.
    //
    // modelClass    - The MTLModel subclass to return. This class must conform to
    //                 <MTLManagedObjectSerializing>. This argument must not be nil.
    // managedObject - The managed object to deserialize. If this argument is nil,
    //                 the method returns nil.
    // error         - If not NULL, this may be set to an error that occurs during
    //                 deserialization or initializing an instance of `modelClass`.
    //
    // Returns an instance of `modelClass` upon success, or nil if an error
    // occurred.
    + (id)modelOfClass:(Class)modelClass fromManagedObject:(NSManagedObject *)managedObject error:(NSError **)error;
    
    // Serializes a MTLModel into an NSManagedObject.
    //
    // model   - The model object to serialize. This argument must not be nil.
    // context - The context into which to insert the created managed object. This
    //           argument must not be nil.
    // error   - If not NULL, this may be set to an error that occurs during
    //           serialization or insertion.
    + (id)managedObjectFromModel:(AWSMTLModel<AWSMTLManagedObjectSerializing> *)model insertingIntoContext:(NSManagedObjectContext *)context error:(NSError **)error;
    
    @end

    Swift

    class AWSMTLManagedObjectAdapter : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSMTLModel : NSObject <NSCopying>
    
    // Returns a new instance of the receiver initialized using
    // -initWithDictionary:error:.
    + (instancetype)modelWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error;
    
    // Initializes the receiver with default values.
    //
    // This is the designated initializer for this class.
    - (instancetype)init;
    
    // Initializes the receiver using key-value coding, setting the keys and values
    // in the given dictionary.
    //
    // Subclass implementations may override this method, calling the super
    // implementation, in order to perform further processing and initialization
    // after deserialization.
    //
    // dictionaryValue - Property keys and values to set on the receiver. Any NSNull
    //                   values will be converted to nil before being used. KVC
    //                   validation methods will automatically be invoked for all of
    //                   the properties given. If nil, this method is equivalent to
    //                   -init.
    // error           - If not NULL, this may be set to any error that occurs
    //                   (like a KVC validation error).
    //
    // Returns an initialized model object, or nil if validation failed.
    - (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error;
    
    // Returns the keys for all @property declarations, except for `readonly`
    // properties without ivars, or properties on MTLModel itself.
    + (NSSet *)propertyKeys;
    
    // A dictionary representing the properties of the receiver.
    //
    // The default implementation combines the values corresponding to all
    // +propertyKeys into a dictionary, with any nil values represented by NSNull.
    //
    // This property must never be nil.
    @property (nonatomic, copy, readonly) NSDictionary *dictionaryValue;
    
    // Merges the value of the given key on the receiver with the value of the same
    // key from the given model object, giving precedence to the other model object.
    //
    // By default, this method looks for a `-merge<Key>FromModel:` method on the
    // receiver, and invokes it if found. If not found, and `model` is not nil, the
    // value for the given key is taken from `model`.
    - (void)mergeValueForKey:(NSString *)key fromModel:(AWSMTLModel *)model;
    
    // Merges the values of the given model object into the receiver, using
    // -mergeValueForKey:fromModel: for each key in +propertyKeys.
    //
    // `model` must be an instance of the receiver's class or a subclass thereof.
    - (void)mergeValuesForKeysFromModel:(AWSMTLModel *)model;
    
    // Compares the receiver with another object for equality.
    //
    // The default implementation is equivalent to comparing both models'
    // -dictionaryValue.
    //
    // Note that this may lead to infinite loops if the receiver holds a circular
    // reference to another MTLModel and both use the default behavior.
    // It is recommended to override -isEqual: in this scenario.
    - (BOOL)isEqual:(id)object;
    
    // A string that describes the contents of the receiver.
    //
    // The default implementation is based on the receiver's class and its
    // -dictionaryValue.
    //
    // Note that this may lead to infinite loops if the receiver holds a circular
    // reference to another MTLModel and both use the default behavior.
    // It is recommended to override -description in this scenario.
    - (NSString *)description;
    
    @end

    Swift

    class AWSMTLModel : NSObject, NSCopying
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSMTLValueTransformer : NSValueTransformer
    
    // Returns a transformer which transforms values using the given block. Reverse
    // transformations will not be allowed.
    + (instancetype)transformerWithBlock:(AWSMTLValueTransformerBlock)transformationBlock;
    
    // Returns a transformer which transforms values using the given block, for
    // forward or reverse transformations.
    + (instancetype)reversibleTransformerWithBlock:(AWSMTLValueTransformerBlock)transformationBlock;
    
    // Returns a transformer which transforms values using the given blocks.
    + (instancetype)reversibleTransformerWithForwardBlock:(AWSMTLValueTransformerBlock)forwardBlock reverseBlock:(AWSMTLValueTransformerBlock)reverseBlock;
    
    @end

    Swift

    class AWSMTLValueTransformer : ValueTransformer

AWSNetworking

AWSNetworkingConfiguration

  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSNetworkingConfiguration : NSObject <NSCopying>
    
    @property (nonatomic, readonly) NSURL *URL;
    @property (nonatomic, strong) NSURL *baseURL;
    @property (nonatomic, strong) NSString *URLString;
    @property (nonatomic, assign) AWSHTTPMethod HTTPMethod;
    @property (nonatomic, strong) NSDictionary *headers;
    @property (nonatomic, assign) BOOL allowsCellularAccess;
    @property (nonatomic, strong) NSString *sharedContainerIdentifier;
    
    @property (nonatomic, strong) id<AWSURLRequestSerializer> requestSerializer;
    @property (nonatomic, strong) NSArray<id<AWSNetworkingRequestInterceptor>> *requestInterceptors;
    @property (nonatomic, strong) id<AWSHTTPURLResponseSerializer> responseSerializer;
    @property (nonatomic, strong) NSArray<id<AWSNetworkingHTTPResponseInterceptor>> *responseInterceptors;
    @property (nonatomic, strong) id<AWSURLRequestRetryHandler> retryHandler;
    
    /**
     The maximum number of retries for failed requests. The value needs to be between 0 and 10 inclusive. If set to higher than 10, it becomes 10.
     */
    @property (nonatomic, assign) uint32_t maxRetryCount;
    
    /**
     The timeout interval to use when waiting for additional data.
     */
    @property (nonatomic, assign) NSTimeInterval timeoutIntervalForRequest;
    
    /**
     The maximum amount of time that a resource request should be allowed to take.
     */
    @property (nonatomic, assign) NSTimeInterval timeoutIntervalForResource;
    
    @end

    Swift

    class AWSNetworkingConfiguration : NSObject, NSCopying

AWSNetworkingRequest

  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSNetworkingRequest : AWSNetworkingConfiguration
    
    @property (nonatomic, strong) NSDictionary *parameters;
    @property (nonatomic, strong) NSURL *uploadingFileURL;
    @property (nonatomic, strong) NSURL *downloadingFileURL;
    @property (nonatomic, assign) BOOL shouldWriteDirectly;
    
    @property (nonatomic, copy) AWSNetworkingUploadProgressBlock uploadProgress;
    @property (nonatomic, copy) AWSNetworkingDownloadProgressBlock downloadProgress;
    
    @property (readonly, nonatomic, strong) NSURLSessionTask *task;
    @property (readonly, nonatomic, assign, getter = isCancelled) BOOL cancelled;
    
    - (void)assignProperties:(AWSNetworkingConfiguration *)configuration;
    - (void)cancel;
    - (void)pause;
    
    @end

    Swift

    class AWSNetworkingRequest : AWSNetworkingConfiguration
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSRequest : AWSModel
    
    @property (nonatomic, copy) AWSNetworkingUploadProgressBlock uploadProgress;
    @property (nonatomic, copy) AWSNetworkingDownloadProgressBlock downloadProgress;
    @property (nonatomic, assign, readonly, getter = isCancelled) BOOL cancelled;
    @property (nonatomic, strong) NSURL *downloadingFileURL;
    
    - (AWSTask *)cancel;
    - (AWSTask *)pause;
    
    @end

    Swift

    class AWSRequest : AWSModel
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSNetworkingRequestInterceptor : NSObject <AWSNetworkingRequestInterceptor>
    
    @property (nonatomic, readonly) NSString *userAgent;
    
    - (instancetype)initWithUserAgent:(NSString *)userAgent;
    
    @end

    Swift

    class AWSNetworkingRequestInterceptor : NSObject, AWSNetworkingRequestInterceptorProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSNetworkingHelpers : NSObject
    
    /**
     Returns an array of NSURLQueryItems constructed from the request parameters. The query items in the array are not
     URL encoded.
    
     Supported value types of the dictionary are String or Array. Any other type of value will throw an
     NSInternalInconsistencyException. If the value is an array, each value will be added to the resulting array using the
     key, for example: `{"key1", ["value1", "value2"]}` would result in an array `[("key1", "value1"), ("key1", "value2")]`.
    
     @param requestParameters an NSDictionary<NSString *, (NSString * | NSArray<NSString *>)>
     @return an array of NSURLQueryItems
     */
    + (NSArray<NSURLQueryItem *> * _Nonnull)queryItemsFromDictionary:(NSDictionary<NSString *, id> * _Nonnull)requestParameters;
    
    @end

    Swift

    class AWSNetworkingHelpers : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSURLSessionManager : NSObject <NSURLSessionDelegate, NSURLSessionDataDelegate>
    
    @property (nonatomic, strong) AWSNetworkingConfiguration *configuration;
    
    - (instancetype)initWithConfiguration:(AWSNetworkingConfiguration *)configuration;
    
    - (AWSTask *)dataTaskWithRequest:(AWSNetworkingRequest *)request;
    
    @end

    Swift

    class AWSURLSessionManager : NSObject, URLSessionDelegate, URLSessionDataDelegate
  • Declaration

    Objective-C

    @interface AWSSTSAssumeRoleRequest : AWSRequest

    Swift

    class AWSSTSAssumeRoleRequest : AWSRequest
  • Contains the response to a successful AssumeRole request, including temporary Amazon Web Services credentials that can be used to make Amazon Web Services requests.

    See more

    Declaration

    Objective-C

    @interface AWSSTSAssumeRoleResponse : AWSModel

    Swift

    class AWSSTSAssumeRoleResponse : AWSModel
  • Declaration

    Objective-C

    @interface AWSSTSAssumeRoleWithSAMLRequest : AWSRequest

    Swift

    class AWSSTSAssumeRoleWithSAMLRequest : AWSRequest
  • Contains the response to a successful AssumeRoleWithSAML request, including temporary Amazon Web Services credentials that can be used to make Amazon Web Services requests.

    See more

    Declaration

    Objective-C

    @interface AWSSTSAssumeRoleWithSAMLResponse : AWSModel

    Swift

    class AWSSTSAssumeRoleWithSAMLResponse : AWSModel
  • Declaration

    Objective-C

    @interface AWSSTSAssumeRoleWithWebIdentityRequest : AWSRequest

    Swift

    class AWSSTSAssumeRoleWithWebIdentityRequest : AWSRequest
  • Contains the response to a successful AssumeRoleWithWebIdentity request, including temporary Amazon Web Services credentials that can be used to make Amazon Web Services requests.

    See more

    Declaration

    Objective-C

    @interface AWSSTSAssumeRoleWithWebIdentityResponse : AWSModel

    Swift

    class AWSSTSAssumeRoleWithWebIdentityResponse : AWSModel
  • The identifiers for the temporary security credentials that the operation returns.

    Required parameters: [AssumedRoleId, Arn]

    See more

    Declaration

    Objective-C

    @interface AWSSTSAssumedRoleUser : AWSModel

    Swift

    class AWSSTSAssumedRoleUser : AWSModel
  • Amazon Web Services credentials for API authentication.

    Required parameters: [AccessKeyId, SecretAccessKey, SessionToken, Expiration]

    See more

    Declaration

    Objective-C

    @interface AWSSTSCredentials : AWSModel

    Swift

    class AWSSTSCredentials : AWSModel
  • Declaration

    Objective-C

    @interface AWSSTSDecodeAuthorizationMessageRequest : AWSRequest

    Swift

    class AWSSTSDecodeAuthorizationMessageRequest : AWSRequest
  • A document that contains additional information about the authorization status of a request from an encoded message that is returned in response to an Amazon Web Services request.

    See more

    Declaration

    Objective-C

    @interface AWSSTSDecodeAuthorizationMessageResponse : AWSModel

    Swift

    class AWSSTSDecodeAuthorizationMessageResponse : AWSModel
  • Identifiers for the federated user that is associated with the credentials.

    Required parameters: [FederatedUserId, Arn]

    See more

    Declaration

    Objective-C

    @interface AWSSTSFederatedUser : AWSModel

    Swift

    class AWSSTSFederatedUser : AWSModel
  • Declaration

    Objective-C

    @interface AWSSTSGetAccessKeyInfoRequest : AWSRequest

    Swift

    class AWSSTSGetAccessKeyInfoRequest : AWSRequest
  • Declaration

    Objective-C

    @interface AWSSTSGetAccessKeyInfoResponse : AWSModel

    Swift

    class AWSSTSGetAccessKeyInfoResponse : AWSModel
  • Declaration

    Objective-C

    @interface AWSSTSGetCallerIdentityRequest : AWSRequest

    Swift

    class AWSSTSGetCallerIdentityRequest : AWSRequest
  • Contains the response to a successful GetCallerIdentity request, including information about the entity making the request.

    See more

    Declaration

    Objective-C

    @interface AWSSTSGetCallerIdentityResponse : AWSModel

    Swift

    class AWSSTSGetCallerIdentityResponse : AWSModel
  • Declaration

    Objective-C

    @interface AWSSTSGetFederationTokenRequest : AWSRequest

    Swift

    class AWSSTSGetFederationTokenRequest : AWSRequest
  • Contains the response to a successful GetFederationToken request, including temporary Amazon Web Services credentials that can be used to make Amazon Web Services requests.

    See more

    Declaration

    Objective-C

    @interface AWSSTSGetFederationTokenResponse : AWSModel

    Swift

    class AWSSTSGetFederationTokenResponse : AWSModel
  • Declaration

    Objective-C

    @interface AWSSTSGetSessionTokenRequest : AWSRequest

    Swift

    class AWSSTSGetSessionTokenRequest : AWSRequest
  • Contains the response to a successful GetSessionToken request, including temporary Amazon Web Services credentials that can be used to make Amazon Web Services requests.

    See more

    Declaration

    Objective-C

    @interface AWSSTSGetSessionTokenResponse : AWSModel

    Swift

    class AWSSTSGetSessionTokenResponse : AWSModel
  • A reference to the IAM managed policy that is passed as a session policy for a role session or a federated user session.

    See more

    Declaration

    Objective-C

    @interface AWSSTSPolicyDescriptorType : AWSModel

    Swift

    class AWSSTSPolicyDescriptorType : AWSModel
  • Contains information about the provided context. This includes the signed and encrypted trusted context assertion and the context provider ARN from which the trusted context assertion was generated.

    See more

    Declaration

    Objective-C

    @interface AWSSTSProvidedContext : AWSModel

    Swift

    class AWSSTSProvidedContext : AWSModel
  • You can pass custom key-value pair attributes when you assume a role or federate a user. These are called session tags. You can then use the session tags to control access to resources. For more information, see Tagging Amazon Web Services STS Sessions in the IAM User Guide.

    Required parameters: [Key, Value]

    See more

    Declaration

    Objective-C

    @interface AWSSTSTag : AWSModel

    Swift

    class AWSSTSTag : AWSModel
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSSTSResources : NSObject
    
    + (instancetype)sharedInstance;
    
    - (NSDictionary *)JSONObject;
    
    @end

    Swift

    class AWSSTSResources : NSObject
  • Security Token Service

    Security Token Service (STS) enables you to request temporary, limited-privilege credentials for users. This guide provides descriptions of the STS API. For more information about using this service, see Temporary Security Credentials.

    See more

    Declaration

    Objective-C

    @interface AWSSTS : AWSService

    Swift

    class AWSSTS : AWSService
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSJSONDictionary : NSDictionary
    
    - (instancetype)initWithDictionary:(NSDictionary *)otherDictionary
                    JSONDefinitionRule:(NSDictionary *)rule;
    - (NSUInteger)count;
    - (id)objectForKey:(id)aKey;
    
    @end

    Swift

    class AWSJSONDictionary : NSDictionary
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSXMLBuilder : NSObject
    
    + (NSData *)xmlDataForDictionary:(NSDictionary *)params
                          actionName:(NSString *)actionName
               serviceDefinitionRule:(NSDictionary *)serviceDefinitionRule
                               error:(NSError *__autoreleasing *)error;
    
    + (NSString *)xmlStringForDictionary:(NSDictionary *)params
                              actionName:(NSString *)actionName
                   serviceDefinitionRule:(NSDictionary *)serviceDefinitionRule
                                   error:(NSError *__autoreleasing *)error;
    
    @end

    Swift

    class AWSXMLBuilder : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSXMLParser : NSObject
    
    + (AWSXMLParser *)sharedInstance;
    
    - (NSMutableDictionary *)dictionaryForXMLData:(NSData *)data
                                       actionName:(NSString *)actionName
                            serviceDefinitionRule:(NSDictionary *)serviceDefinitionRule
                                            error:(NSError *__autoreleasing *)error;
    
    @end

    Swift

    class AWSXMLParser : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSQueryParamBuilder : NSObject
    
    + (NSDictionary *)buildFormattedParams:(NSDictionary *)params
                                actionName:(NSString *)actionName
                     serviceDefinitionRule:(NSDictionary *)serviceDefinitionRule
                                     error:(NSError *__autoreleasing *)error;
    
    @end

    Swift

    class AWSQueryParamBuilder : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSEC2ParamBuilder : NSObject
    
    + (NSDictionary *)buildFormattedParams:(NSDictionary *)params
                                actionName:(NSString *)actionName
                     serviceDefinitionRule:(NSDictionary *)serviceDefinitionRule
                                     error:(NSError *__autoreleasing *)error;
    
    @end

    Swift

    class AWSEC2ParamBuilder : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSJSONBuilder : NSObject
    
    + (NSData *)jsonDataForDictionary:(NSDictionary *)params
                           actionName:(NSString *)actionName
                serviceDefinitionRule:(NSDictionary *)serviceDefinitionRule
                                error:(NSError *__autoreleasing *)error;
    
    @end

    Swift

    class AWSJSONBuilder : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSJSONParser : NSObject
    
    + (NSDictionary *)dictionaryForJsonData:(NSData *)data
                                   response:(NSHTTPURLResponse *)response
                                 actionName:(NSString *)actionName
                      serviceDefinitionRule:(NSDictionary *)serviceDefinitionRule
                                      error:(NSError *__autoreleasing *)error;
    
    @end

    Swift

    class AWSJSONParser : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSTimestampSerialization: NSObject
    
    + (nullable NSString *)serializeTimestamp:(NSDictionary *)rules
                                        value:(NSDate *)value
                                        error:(NSError *__autoreleasing *)error;
    
    + (nullable NSDate *)parseTimestamp:(id)value;
    
    @end

    Swift

    class AWSTimestampSerialization : NSObject
  • Undocumented

    Declaration

    Objective-C

    @interface AWSJSONTimestampSerialization: AWSTimestampSerialization
    @end

    Swift

    class AWSJSONTimestampSerialization : AWSTimestampSerialization
  • Undocumented

    Declaration

    Objective-C

    @interface AWSXMLTimestampSerialization: AWSTimestampSerialization
    @end

    Swift

    class AWSXMLTimestampSerialization : AWSTimestampSerialization
  • Undocumented

    Declaration

    Objective-C

    @interface AWSQueryTimestampSerialization: AWSTimestampSerialization
    @end

    Swift

    class AWSQueryTimestampSerialization : AWSTimestampSerialization
  • Undocumented

    Declaration

    Objective-C

    @interface AWSEC2TimestampSerialization: AWSTimestampSerialization
    @end

    Swift

    class AWSEC2TimestampSerialization : AWSTimestampSerialization
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSURLRequestRetryHandler : NSObject <AWSURLRequestRetryHandler>
    
    @property (nonatomic, assign) uint32_t maxRetryCount;
    
    - (instancetype)initWithMaximumRetryCount:(uint32_t)maxRetryCount;
    
    @end

    Swift

    class AWSURLRequestRetryHandler : NSObject, AWSURLRequestRetryHandlerProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSJSONRequestSerializer : NSObject <AWSURLRequestSerializer>
    
    - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition
                                actionName:(NSString *)actionName;
    
    @end

    Swift

    class AWSJSONRequestSerializer : NSObject, AWSURLRequestSerializer
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSXMLRequestSerializer : NSObject <AWSURLRequestSerializer>
    
    - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition
                          actionName:(NSString *)actionName;
    
    + (BOOL)constructURIandHeadersAndBody:(NSMutableURLRequest *)request
                                    rules:(AWSJSONDictionary *)rules
                               parameters:(NSDictionary *)params
                                uriSchema:(NSString *)uriSchema
                               hostPrefix:(NSString *)hostPrefix
                                    error:(NSError *__autoreleasing *)error;
    @end

    Swift

    class AWSXMLRequestSerializer : NSObject, AWSURLRequestSerializer
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSQueryStringRequestSerializer : NSObject <AWSURLRequestSerializer>
    
    - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition
                                actionName:(NSString *)actionName;
    
    @property (nonatomic, strong) NSDictionary *additionalParameters;
    
    @end

    Swift

    class AWSQueryStringRequestSerializer : NSObject, AWSURLRequestSerializer
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSJSONResponseSerializer : NSObject <AWSHTTPURLResponseSerializer>
    
    @property (nonatomic, strong, readonly) NSDictionary *serviceDefinitionJSON;
    @property (nonatomic, strong, readonly) NSString *actionName;
    @property (nonatomic, assign, readonly) Class outputClass;
    
    - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition
                                actionName:(NSString *)actionName
                               outputClass:(Class)outputClass;
    
    @end

    Swift

    class AWSJSONResponseSerializer : NSObject, AWSHTTPURLResponseSerializer
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSXMLResponseSerializer : NSObject <AWSHTTPURLResponseSerializer>
    
    @property (nonatomic, assign) Class outputClass;
    
    - (instancetype)initWithJSONDefinition:(NSDictionary *)JSONDefinition
                                actionName:(NSString *)actionName
                               outputClass:(Class)outputClass;
    
    + (NSMutableDictionary *)parseResponse:(NSHTTPURLResponse *)response
                                     rules:(AWSJSONDictionary *)rules
                            bodyDictionary:(NSMutableDictionary *)bodyDictionary
                                     error:(NSError *__autoreleasing *)error;
    @end

    Swift

    class AWSXMLResponseSerializer : NSObject, AWSHTTPURLResponseSerializer
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSClientContext : NSObject
    
    #pragma mark - App Details
    @property (nonatomic, strong, readonly) NSString *installationId;
    @property (nonatomic, strong) NSString *appVersion;
    @property (nonatomic, strong) NSString *appBuild;
    @property (nonatomic, strong) NSString *appPackageName;
    @property (nonatomic, strong) NSString *appName;
    
    #pragma mark - Device Details
    @property (nonatomic, strong) NSString *devicePlatformVersion;
    @property (nonatomic, strong) NSString *devicePlatform;
    @property (nonatomic, strong) NSString *deviceManufacturer;
    @property (nonatomic, strong) NSString *deviceModel;
    @property (nonatomic, strong) NSString *deviceModelVersion;
    @property (nonatomic, strong) NSString *deviceLocale;
    
    #pragma mark - Custom Attributes
    @property (nonatomic, strong) NSDictionary *customAttributes;
    
    #pragma mark - Service Details
    @property (nonatomic, strong, readonly) NSDictionary *serviceDetails;
    
    - (instancetype)init;
    
    - (NSDictionary *)dictionaryRepresentation;
    
    - (NSString *)JSONString;
    
    - (NSString *)base64EncodedJSONString;
    
    - (void)setDetails:(id)details
            forService:(NSString *)service;
    
    @end

    Swift

    class AWSClientContext : NSObject
  • The AWSInfo holds the configuration values for the various supported services.

    See more

    Declaration

    Objective-C

    @interface AWSInfo : NSObject

    Swift

    class AWSInfo : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSServiceInfo : NSObject
    
    @property (nonatomic, readonly) AWSCognitoCredentialsProvider *cognitoCredentialsProvider;
    
    @property (nonatomic, readonly) AWSRegionType region;
    
    @property (nonatomic, readonly) NSDictionary <NSString *, id> *infoDictionary;
    
    @end

    Swift

    class AWSServiceInfo : NSObject

AWSService

  • An abstract representation of AWS services.

    See more

    Declaration

    Objective-C

    @interface AWSService : NSObject

    Swift

    class AWSService : NSObject

AWSServiceManager

  • The service manager class that manages the default service configuration.

    See more

    Declaration

    Objective-C

    @interface AWSServiceManager : NSObject

    Swift

    class AWSServiceManager : NSObject

AWSServiceConfiguration

AWSEndpoint

  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSEndpoint : NSObject
    
    @property (nonatomic, readonly) AWSRegionType regionType;
    @property (nonatomic, readonly) NSString *regionName;
    @property (nonatomic, readonly) AWSServiceType serviceType;
    @property (nonatomic, readonly) NSString *serviceName;
    @property (nonatomic, readonly) NSString *signingName;
    @property (nonatomic, readonly) NSURL *URL;
    @property (nonatomic, readonly) NSString *hostName;
    @property (nonatomic, readonly) BOOL useUnsafeURL;
    @property (nonatomic, readonly) NSNumber *portNumber;
    
    + (NSString *)regionNameFromType:(AWSRegionType)regionType;
    
    - (instancetype)initWithRegion:(AWSRegionType)regionType
                           service:(AWSServiceType)serviceType
                      useUnsafeURL:(BOOL)useUnsafeURL;
    
    - (instancetype)initWithRegion:(AWSRegionType)regionType
                           service:(AWSServiceType)serviceType
                               URL:(NSURL *)URL;
    
    - (instancetype)initWithRegion:(AWSRegionType)regionType
                       serviceName:(NSString *)serviceName
                               URL:(NSURL *)URL;
    
    - (instancetype)initWithURL:(NSURL *)URL;
    
    - (instancetype)initWithURLString:(NSString *)URLString;
    
    - (instancetype)initLocalEndpointWithRegion:(AWSRegionType)regionType
                                        service:(AWSServiceType)serviceType
                                   useUnsafeURL:(BOOL)useUnsafeURL;
    
    @end

    Swift

    class AWSEndpoint : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSUICKeyChainStore : NSObject
    
    @property (nonatomic, readonly) AWSUICKeyChainStoreItemClass itemClass;
    
    @property (nonatomic, readonly, nullable) NSString *service;
    @property (nonatomic, readonly, nullable) NSString *accessGroup;
    
    @property (nonatomic, readonly, nullable) NSURL *server;
    @property (nonatomic, readonly) AWSUICKeyChainStoreProtocolType protocolType;
    @property (nonatomic, readonly) AWSUICKeyChainStoreAuthenticationType authenticationType;
    
    @property (nonatomic) AWSUICKeyChainStoreAccessibility accessibility;
    @property (nonatomic, readonly) AWSUICKeyChainStoreAuthenticationPolicy authenticationPolicy
    __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
    
    @property (nonatomic) BOOL synchronizable;
    
    @property (nonatomic, nullable) NSString *authenticationPrompt
    __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_8_0);
    
    @property (nonatomic, readonly, nullable) NSArray UIC_KEY_TYPE *allKeys;
    @property (nonatomic, readonly, nullable) NSArray *allItems;
    
    + (NSString *)defaultService;
    + (void)setDefaultService:(NSString *)defaultService;
    
    + (AWSUICKeyChainStore *)keyChainStore;
    + (AWSUICKeyChainStore *)keyChainStoreWithService:(nullable NSString *)service;
    + (AWSUICKeyChainStore *)keyChainStoreWithService:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup;
    
    + (AWSUICKeyChainStore *)keyChainStoreWithServer:(NSURL *)server protocolType:(AWSUICKeyChainStoreProtocolType)protocolType;
    + (AWSUICKeyChainStore *)keyChainStoreWithServer:(NSURL *)server protocolType:(AWSUICKeyChainStoreProtocolType)protocolType authenticationType:(AWSUICKeyChainStoreAuthenticationType)authenticationType;
    
    - (instancetype)init;
    - (instancetype)initWithService:(nullable NSString *)service;
    - (instancetype)initWithService:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup;
    
    - (instancetype)initWithServer:(NSURL *)server protocolType:(AWSUICKeyChainStoreProtocolType)protocolType;
    - (instancetype)initWithServer:(NSURL *)server protocolType:(AWSUICKeyChainStoreProtocolType)protocolType authenticationType:(AWSUICKeyChainStoreAuthenticationType)authenticationType;
    
    + (nullable NSString *)stringForKey:(NSString *)key;
    + (nullable NSString *)stringForKey:(NSString *)key service:(nullable NSString *)service;
    + (nullable NSString *)stringForKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup;
    + (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key;
    + (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key service:(nullable NSString *)service;
    + (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup;
    
    + (nullable NSData *)dataForKey:(NSString *)key;
    + (nullable NSData *)dataForKey:(NSString *)key service:(nullable NSString *)service;
    + (nullable NSData *)dataForKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup;
    + (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key;
    + (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key service:(nullable NSString *)service;
    + (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup;
    
    - (BOOL)contains:(nullable NSString *)key;
    
    - (BOOL)setString:(nullable NSString *)string forKey:(nullable NSString *)key;
    - (BOOL)setString:(nullable NSString *)string forKey:(nullable NSString *)key label:(nullable NSString *)label comment:(nullable NSString *)comment;
    - (nullable NSString *)stringForKey:(NSString *)key;
    
    - (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key;
    - (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key label:(nullable NSString *)label comment:(nullable NSString *)comment;
    - (nullable NSData *)dataForKey:(NSString *)key;
    
    + (BOOL)removeItemForKey:(NSString *)key;
    + (BOOL)removeItemForKey:(NSString *)key service:(nullable NSString *)service;
    + (BOOL)removeItemForKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup;
    
    + (BOOL)removeAllItems;
    + (BOOL)removeAllItemsForService:(nullable NSString *)service;
    + (BOOL)removeAllItemsForService:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup;
    
    - (BOOL)removeItemForKey:(NSString *)key;
    
    - (BOOL)removeAllItems;
    
    - (nullable NSString *)objectForKeyedSubscript:(NSString<NSCopying> *)key;
    - (void)setObject:(nullable NSString *)obj forKeyedSubscript:(NSString<NSCopying> *)key;
    
    + (nullable NSArray UIC_KEY_TYPE *)allKeysWithItemClass:(AWSUICKeyChainStoreItemClass)itemClass;
    - (nullable NSArray UIC_KEY_TYPE *)allKeys;
    
    + (nullable NSArray *)allItemsWithItemClass:(AWSUICKeyChainStoreItemClass)itemClass;
    - (nullable NSArray *)allItems;
    
    - (void)setAccessibility:(AWSUICKeyChainStoreAccessibility)accessibility authenticationPolicy:(AWSUICKeyChainStoreAuthenticationPolicy)authenticationPolicy
    __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
    
    #if TARGET_OS_IOS
    - (void)sharedPasswordWithCompletion:(nullable void (^)(NSString * __nullable account, NSString * __nullable password, NSError * __nullable error))completion;
    - (void)sharedPasswordForAccount:(NSString *)account completion:(nullable void (^)(NSString * __nullable password, NSError * __nullable error))completion;
    
    - (void)setSharedPassword:(nullable NSString *)password forAccount:(NSString *)account completion:(nullable void (^)(NSError * __nullable error))completion;
    - (void)removeSharedPasswordForAccount:(NSString *)account completion:(nullable void (^)(NSError * __nullable error))completion;
    
    + (void)requestSharedWebCredentialWithCompletion:(nullable void (^)(NSArray UIC_CREDENTIAL_TYPE *credentials, NSError * __nullable error))completion;
    + (void)requestSharedWebCredentialForDomain:(nullable NSString *)domain account:(nullable NSString *)account completion:(nullable void (^)(NSArray UIC_CREDENTIAL_TYPE *credentials, NSError * __nullable error))completion;
    
    + (NSString *)generatePassword;
    
    #endif
    
    /// Migrate the existing items in keychain to the current accessibility
    ///
    /// Invoke this method if you have changed the keychain accessibility but there are already existing keychain items
    /// stored with a different accessibility setting.
    - (void)migrateToCurrentAccessibility;
    
    @end

    Swift

    class AWSUICKeyChainStore : NSObject
  • Deprecated

    use AWSDDLog instead

    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:

    Swift

    AWSLogger.defaultLogger().logLevel = .None
    

    The following logging level options are available:

    .None
    .Error
    .Warn
    .Info
    .Debug (This is the default.)
    .Verbose
    

    Objective-C

    [AWSLogger defaultLogger].logLevel = AWSLogLevelNone;
    

    The following logging level options are available:

    AWSLogLevelNone
    AWSLogLevelError
    AWSLogLevelWarn
    AWSLogLevelInfo
    AWSLogLevelDebug (This is the default.)
    AWSLogLevelVerbose
    

    Note

    We recommend setting the log level to None before publishing to the Apple App Store.
    See more

    Declaration

    Objective-C

    
    @interface AWSLogger : NSObject

    Swift

    class AWSLogger : NSObject
  • Undocumented

    Declaration

    Objective-C

    @interface AWSModel : AWSMTLModel <AWSMTLJSONSerializing, NSSecureCoding>
    
    @end

    Swift

    class AWSModel : AWSMTLModel, AWSMTLJSONSerializing, NSSecureCoding
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSModelUtility : NSObject
    
    + (NSDictionary *)mapMTLDictionaryFromJSONArrayDictionary:(NSDictionary *)JSONArrayDictionary
                                             arrayElementType:(NSString *)arrayElementType
                                               withModelClass:(Class)modelClass;
    + (NSDictionary *)JSONArrayDictionaryFromMapMTLDictionary:(NSDictionary *)mapMTLDictionary
                                             arrayElementType:(NSString *)arrayElementType;
    
    + (NSArray *)mapMTLArrayFromJSONArray:(NSArray *)JSONArray
                           withModelClass:(Class)modelClass;
    + (NSArray *)JSONArrayFromMapMTLArray:(NSArray *)mapMTLArray;
    
    + (NSDictionary *)mapMTLDictionaryFromJSONDictionary:(NSDictionary *)JSONDictionary
                                          withModelClass:(Class)modelClass;
    + (NSDictionary *)JSONDictionaryFromMapMTLDictionary:(NSDictionary *)mapMTLDictionary;
    
    @end

    Swift

    class AWSModelUtility : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSNSCodingUtilities: NSObject
    
    #pragma mark - Archive
    
    /// On iOS 11 and greater, uses `+[NSKeyedArchiver
    /// archivedDataWithRootObject:requiringSecureCoding:error:]` to archive data, otherwise uses
    /// `+[NSKeyedArchiver archivedDataWithRootObject:]`
    + (nullable NSData *)versionSafeArchivedDataWithRootObject:(id)obj
                                         requiringSecureCoding:(BOOL)requireSecureCoding
                                                         error:(NSError *__autoreleasing *)error;
    
    #pragma mark - Unarchive
    
    /// On iOS 11 and greater, uses `+[NSKeyedUnarchiver
    /// unarchivedObjectOfClass:fromData:error:]` to unarchive data, otherwise uses
    /// `+[NSKeyedUnarchiver unarchiveObjectWithData:]`
    + (nullable id)versionSafeUnarchivedObjectOfClass:(Class)cls
                                             fromData:(NSData *)data
                                                error:(NSError *__autoreleasing *)error;
    
    /// On iOS 11 and greater, uses `+[NSKeyedUnarchiver
    /// unarchivedObjectOfClasses:fromData:error:]` to unarchive data, otherwise uses
    /// `+[NSKeyedUnarchiver unarchiveObjectWithData:]`
    + (nullable id)versionSafeUnarchivedObjectOfClasses:(NSSet<Class> *)classes
                                               fromData:(NSData *)data
                                                  error:(NSError *__autoreleasing *)error;
    
    /// On iOS 11 and greater, uses `+[NSKeyedUnarchiver
    /// unarchivedObjectOfClasses:fromData:error:]` to unarchive data into a mutable
    /// dictionary that allows NSDictionary and NSMutableString in its allowed class
    /// set, otherwise uses `+[NSKeyedUnarchiver unarchiveObjectWithData:]`
    + (nullable NSMutableDictionary *)versionSafeMutableDictionaryFromData:(NSData *)data
                                                                     error:(NSError *__autoreleasing *)error;
    
    @end

    Swift

    class AWSNSCodingUtilities : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSSynchronizedMutableDictionary<KeyType, ObjectType> : NSObject
    
    @property (readonly, copy) NSArray<KeyType> *allKeys;
    @property (readonly, copy) NSArray<ObjectType> *allValues;
    @property (readonly, nonatomic, strong) NSUUID *instanceKey;
    
    /// Create new instance.
    - (instancetype)init;
    
    /// Creates another dictionary which syncs on the same queue.
    - (instancetype)syncedDictionary;
    
    - (id)objectForKey:(id)aKey;
    - (void)setObject:(id)anObject forKey:(id <NSCopying>)aKey;
    
    - (void)removeObject:(id)object;
    - (void)removeObjectForKey:(id)aKey;
    - (void)removeAllObjects;
    
    - (void)mutateWithBlock:(void (^)(NSMutableDictionary *))block;
    + (void)mutateSyncedDictionaries:(NSArray<AWSSynchronizedMutableDictionary *> *)dictionaries
                           withBlock:(void (^)(NSUUID *, NSMutableDictionary *))block;
    
    - (BOOL)isEqualToAWSSynchronizedMutableDictionary:(AWSSynchronizedMutableDictionary *)other;
    
    @end

    Swift

    class AWSSynchronizedMutableDictionary<KeyType, ObjectType> : NSObject where KeyType : AnyObject, ObjectType : AnyObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSXMLDictionaryParser : NSObject <NSCopying>
    
    + (AWSXMLDictionaryParser *)sharedInstance;
    
    @property (nonatomic, assign) BOOL collapseTextNodes; // defaults to YES
    @property (nonatomic, assign) BOOL stripEmptyNodes;   // defaults to YES
    @property (nonatomic, assign) BOOL trimWhiteSpace;    // defaults to YES
    @property (nonatomic, assign) BOOL alwaysUseArrays;   // defaults to NO
    @property (nonatomic, assign) BOOL preserveComments;  // defaults to NO
    @property (nonatomic, assign) BOOL wrapRootNode;      // defaults to NO
    
    @property (nonatomic, assign) AWSXMLDictionaryAttributesMode attributesMode;
    @property (nonatomic, assign) AWSXMLDictionaryNodeNameMode nodeNameMode;
    
    - (NSDictionary *)dictionaryWithParser:(NSXMLParser *)parser;
    - (NSDictionary *)dictionaryWithData:(NSData *)data;
    - (NSDictionary *)dictionaryWithString:(NSString *)string;
    - (NSDictionary *)dictionaryWithFile:(NSString *)path;
    
    @end

    Swift

    class AWSXMLDictionaryParser : NSObject, NSCopying