Classes
The following classes are available globally.
-
At its core, the Amplify class is simply a router that provides clients top-level access to categories and configuration methods. It provides convenient access to default plugins via the top-level category properties, but clients can access specific plugins by invoking
getPluginon a category and issuing methods directly to that plugin.Warning
It is a serious error to invoke any of the category APIs (likeAnalytics.record()orAPI.mutate()) without first registering plugins viaAmplify.add(plugin:)and configuring Amplify viaAmplify.configure(). Such access will cause a preconditionFailure.There are two exceptions to this. The
LoggingandHubcategories are configured with a default plugin that is available at initialization.- Tag: Amplify
Declaration
-
The API category provides a solution for making HTTP requests to REST and GraphQL endpoints.
See moreDeclaration
Swift
public final class APICategory : Categoryextension APICategory: DefaultLoggerextension APICategory: APICategoryAuthProviderFactoryBehaviorextension APICategory: APICategoryGraphQLBehaviorextension APICategory: APICategoryInterceptorBehaviorextension APICategory: APICategoryRESTBehaviorextension APICategory: APICategoryReachabilityBehaviorextension APICategory: Resettable -
API Auth Provider Factory
See moreDeclaration
Swift
open class APIAuthProviderFactory -
GraphQL Subscription Operation
See moreDeclaration
Swift
open class GraphQLSubscriptionOperation<R: Decodable>: AmplifyInProcessReportingOperation< GraphQLOperationRequest<R>, GraphQLSubscriptionEvent<R>, Void, APIError >, @unchecked Sendable -
GraphQL Operation
See moreDeclaration
Swift
open class GraphQLOperation<R: Decodable>: AmplifyOperation< GraphQLOperationRequest<R>, GraphQLResponse<R>, APIError >, @unchecked Sendable
-
Declaration
Swift
public final class RetryableGraphQLOperation<Payload> where Payload : Decodable -
Declaration
Swift
public final class RetryableGraphQLSubscriptionOperation<Payload> where Payload : Decodable, Payload : Sendable -
REST Request
See moreDeclaration
Swift
public class RESTRequest -
The Analytics category enables you to collect analytics data for your app.
See moreDeclaration
Swift
public final class AnalyticsCategory : Categoryextension AnalyticsCategory: AnalyticsCategoryBehaviorextension AnalyticsCategory: DefaultLoggerextension AnalyticsCategory: Resettable -
Declaration
Swift
public final class AuthCategory : Categoryextension AuthCategory: AuthCategoryBehaviorextension AuthCategory: AuthCategoryDeviceBehaviorextension AuthCategory: AuthCategoryUserBehaviorextension AuthCategory: AuthCategoryWebAuthnBehaviourextension AuthCategory: DefaultLoggerextension AuthCategory: Resettable -
Declaration
Swift
public final class DataStoreCategory : Categoryextension DataStoreCategory: DataStoreBaseBehaviorextension DataStoreCategory: DefaultLoggerextension DataStoreCategory: Resettableextension DataStoreCategory: DataStoreSubscribeBehavior -
This class represents a lazy reference to a
Model, meaning that the reference may or may not exist at instantiation time.The default implementation
See moreDefaultModelProvideronly handles in-memory data, thereforeget()andrequire()will simply return the currentreference.Declaration
Swift
public class LazyReference<ModelType> : Codable, _LazyReferenceValue where ModelType : Model -
See moreList<ModelType>is a customCollectionthat is capable of loading records from a data source. This is especially useful when dealing with Model associations that need to be lazy loaded. Lazy loading is performed when you access theCollectionmethods by retrieving the data from the underlying data source and then stored into this object, before returning the data to you. Consumers must be aware that multiple calls to the data source and then stored into this object will happen simultaneously if the object is used from different threads, thus not thread safe. Lazy loading is idempotent and will return the stored results on subsequent access.Declaration
Swift
public class List<ModelType> : Collection, Codable, ExpressibleByArrayLiteral, ModelListMarker where ModelType : Model -
Represents the
Modelstructure itself, a container of property references.- Example:
“`swift
class PostModelPath : ModelPath
{}
extension ModelPath where ModelType == Post { var id: FieldPath
{ id() } var title: FieldPath { string("title”) } var blog: ModelPath { BlogModelPath(name: “blog”, parent: self) } }
See moreDeclaration
Swift
open class ModelPath<ModelType> : PropertyContainerPath where ModelType : Model - Example:
“`swift
class PostModelPath : ModelPath
-
Declaration
Swift
public class QueryPredicateOperation : QueryPredicate, Encodableextension QueryPredicateOperation: Equatable -
Declaration
Swift
public class QueryPredicateGroup : QueryPredicate, Encodableextension QueryPredicateGroup: Equatable -
The Geo category enables you to interact with geospacial services.
See moreDeclaration
Swift
public final class GeoCategory : Categoryextension GeoCategory: GeoCategoryBehaviorextension GeoCategory: DefaultLoggerextension GeoCategory: Resettable -
Amplify has a local eventing system called Hub. It is a lightweight implementation of Publisher-Subscriber pattern, and is used to share data between modules and components in your app. Hub enables different categories to communicate with one another when specific events occur, such as authentication events like a user sign-in or notification of a file download.
See moreDeclaration
Swift
public final class HubCategory : Categoryextension HubCategory: HubCategoryBehaviorextension HubCategory: DefaultLoggerextension HubCategory: Resettable -
AWS Amplify writes console logs through Logger. You can use Logger in your apps for the same purpose.
See moreDeclaration
Swift
public final class LoggingCategory : Categoryextension LoggingCategory: Resettableextension LoggingCategory: LoggingCategoryClientBehaviorextension LoggingCategory: Loggerextension LoggingCategory: DefaultLogger -
The Notifications parent category
See moreDeclaration
Swift
public final class NotificationsCategory -
The Push Notifications category allows you to receive and report push notifications.
See moreDeclaration
Swift
public final class PushNotificationsCategory : Categoryextension PushNotificationsCategory: Resettableextension PushNotificationsCategory: PushNotificationsCategoryBehaviourextension PushNotificationsCategory: DefaultLogger -
Declaration
Swift
public final class PredictionsCategory : Categoryextension PredictionsCategory: Resettableextension PredictionsCategory: PredictionsCategoryBehaviorextension PredictionsCategory: DefaultLogger -
AWS Amplify Storage module provides a simple mechanism for managing user content for your app in public, protected or private storage buckets.
- Tag: StorageCategory
Declaration
Swift
public final class StorageCategory : Categoryextension StorageCategory: Resettableextension StorageCategory: StorageCategoryBehaviorextension StorageCategory: DefaultLogger -
Declaration
Swift
public class AmplifyAsyncSequence<Element> : AsyncSequence, Cancellable where Element : Sendable -
Declaration
Swift
public class AmplifyAsyncThrowingSequence<Element> : AsyncSequence, Cancellable where Element : Sendable -
An AmplifyOperation that emits InProcess values intermittently during the operation.
Unlike a regular
See moreAmplifyOperation, which emits a single Result at the completion of the operation’s work, anAmplifyInProcessReportingOperationmay emit intermediate values while its work is ongoing. These values could be incidental to the operation (such as aStorage.downloadFileoperation reporting Progress values periodically as the download proceeds), or they could be the primary delivery mechanism for an operation (such as aGraphQLSubscriptionOperation‘s emitting new subscription values).Declaration
Swift
open class AmplifyInProcessReportingOperation< Request: AmplifyOperationRequest, InProcess, Success, Failure: AmplifyError >: AmplifyOperation<Request, Success, Failure>, @unchecked Sendable -
An abstract representation of an Amplify unit of work. Subclasses may aggregate multiple work items to fulfull a single “AmplifyOperation”, such as an “extract text operation” which might include uploading an image to cloud storage, processing it via a Predictions engine, and translating the results.
AmplifyOperations are used by plugin developers to perform tasks on behalf of the calling app. They have a default implementation of a
dispatchmethod that sends a contextualized payload to the Hub.Pausable/resumable tasks that do not require Hub dispatching should use AsynchronousOperation instead.
See moreDeclaration
Swift
open class AmplifyOperation<Request, Success, Failure> : AsynchronousOperation, @unchecked Sendable where Request : AmplifyOperationRequest, Failure : AmplifyErrorextension AmplifyOperation: CategoryTypeableextension AmplifyOperation: HubPayloadEventNameableextension AmplifyOperation: Cancellable -
Declaration
Swift
public class AmplifyOperationTaskAdapter< Request: AmplifyOperationRequest, Success, Failure: AmplifyError >: AmplifyTask, @unchecked Sendable -
Declaration
Swift
public class AmplifyInProcessReportingOperationTaskAdapter< Request: AmplifyOperationRequest, InProcess, Success, Failure: AmplifyError >: AmplifyTask, AmplifyInProcessReportingTask, @unchecked Sendable -
This class is to facilitate executing asychronous requests. The caller can transition the operation to its finished state by calling finish() in the callback of an asychronous request to ensure that the operation is only removed from the OperationQueue after it has completed all its work. This class is not inherently thread safe. Although it is a subclass of Foundation’s Operation, it contains private state to support pausing, resuming, and finishing, that must be managed by callers.
See moreDeclaration
Swift
open class AsynchronousOperation : Operation, @unchecked Sendable -
A class that wraps access to its underlying value with an NSLocking instance.
See moreDeclaration
Swift
public final class AtomicValue<Value> : @unchecked Sendable -
A helper for executing asynchronous work serially.
See moreDeclaration
Swift
public class TaskQueue<Success> -
A Tree data type with a
See morevalueof some typeEandchildrensubtrees.Declaration
Swift
public class Tree<E> -
Declaration
Swift
public class WeakRef<T> where T : AnyObject -
The default Hub plugin provided with the Amplify Framework
No guaranteed delivery order
AWSHubPlugin distributes messages in order to listeners, but makes no guarantees about the order in which a listener is called. This plugin does not guarantee synchronization between message delivery and listener management. In other words, the following sequence is not guaranteed to succeed:
plugin.listen(to: .custom("MyChannel") { event in print("event received: \(event)") } plugin.dispatch(to: .custom("MyChannel"), payload: HubPayload("MY_EVENT"))Instead, messages and listener states are guaranteed to be independently self-consistent. Callers can use
See morehasListener(withToken:)to check that a listener has been registered.Declaration
Swift
public final class AWSHubPlugin : HubCategoryPluginextension AWSHubPlugin: AmplifyVersionable -
A Logging category plugin that forwards calls to the OS’s Unified Logging system
See moreDeclaration
Swift
public final class AWSUnifiedLoggingPlugin : LoggingCategoryPluginextension AWSUnifiedLoggingPlugin: AmplifyVersionable -
Presents a developer menu using the provided
See moreDevMenuPresentationContextProviderupon notification from aTriggerRecognizer. Default recognizer is aLongPressGestureRecognizer -
See moreLoggingCategoryPluginthat wraps anotherLoggingCategoryPluginand saves the logs in memory
View on GitHub
Classes Reference