Protocols

The following protocols are available globally.

  • Objects that conform to the ParseUser protocol have a local representation of a user persisted to the Parse Data. This protocol inherits from the ParseObject protocol, and retains the same functionality of a ParseObject, but also extends it with various user specific methods, like authentication, signing up, and validation uniqueness.

    See more

    Declaration

    Swift

    public protocol ParseUser : ParseObject
  • Objects that conform to the ParseAuthentication protocol provide convenience implementations for using 3rd party authentication methods. The authentication methods supported by the Parse Server can be found here.

    See more

    Declaration

    Swift

    public protocol ParseAuthentication : Decodable, Encodable
  • Objects that conform to the ParseObject protocol have a local representation of data persisted to the Parse cloud. This is the main protocol that is used to interact with objects in your app.

    If you plan to use custom encoding/decoding, be sure to add objectId, createdAt, updatedAt, and ACL to your ParseObject CodingKeys.

    Note

    ParseObjects can be “value types” (structs) or reference types “classes”. If you are using value types there isn’t much else you need to do but to conform to ParseObject. If you are using reference types, see the warning.

    Warning

    If you plan to use “reference types” (classes), you will need to implement your own == method to conform to Equatable along with with the hash method to conform to Hashable. It is important to note that for unsaved ParseObjects, you won’t be able to rely on objectId for Equatable and Hashable as your unsaved objects won’t have this value yet and is nil. A possible way to address this is by creating a UUID for your objects locally and relying on that for Equatable and Hashable, otherwise it’s possible you will get “circular dependency errors” depending on your implementation.
    See more

    Declaration

    Swift

    public protocol ParseObject: Objectable,
                                 Fetchable,
                                 Savable,
                                 Deletable,
                                 Hashable,
                                 CustomDebugStringConvertible
  • Receive/respond to notifications from the ParseLiveQuery Server.

    See more

    Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    public protocol ParseLiveQueryDelegate : AnyObject
  • This protocol describes the interface for handling events from a ParseLiveQuery client. You can use this protocol on any custom class of yours, instead of Subscription, if it fits your use case better.

    See more

    Declaration

    Swift

    public protocol ParseSubscription : AnyObject
  • Objects that conform to the ParseInstallation protocol have a local representation of an installation persisted to the Parse cloud. This protocol inherits from the ParseObject protocol, and retains the same functionality of a ParseObject, but also extends it with installation-specific fields and related immutability and validity checks.

    A valid ParseInstallation can only be instantiated via current because the required identifier fields are readonly. The timeZone and badge fields are also readonly properties which are automatically updated to match the device’s time zone and application badge when the ParseInstallation is saved, thus these fields might not reflect the latest device state if the installation has not recently been saved.

    ParseInstallations which have a valid deviceToken and are saved to the Parse Server can be used to target push notifications. Use setDeviceToken to set the deviceToken properly.

    Warning

    Only use ParseInstallation.current installations on the main thread as they require UIApplication for badge

    Warning

    Linux developers should set appName, appIdentifier, and appVersion manually as ParseSwift doesn’t have access to Bundle.main.
    See more

    Declaration

    Swift

    public protocol ParseInstallation : ParseObject
  • Objects that conform to the ParseRole protocol represent a Role on the Parse Server. ParseRole‘s represent groupings of ParseUser objects for the purposes of granting permissions (e.g. specifying a ParseACL for a ParseObject). Roles are specified by their sets of child users and child roles, all of which are granted any permissions that the parent role has. Roles must have a name (which cannot be changed after creation of the role), and must specify a ParseACL.

    See more

    Declaration

    Swift

    public protocol ParseRole : ParseObject
  • ParseSession is a local representation of a session. This protocol conforms to ParseObject and retains the same functionality.

    See more

    Declaration

    Swift

    public protocol ParseSession : ParseObject
  • A store that supports key/value storage. It should be able to handle any object that conforms to encodable and decodable.

    See more

    Declaration

    Swift

    public protocol ParseKeyValueStore
  • Objects that conform to the ParseCloud protocol are able to call Parse Cloud Functions and Jobs. An object should be instantiated for each function and job type. When conforming to ParseCloud, any properties added will be passed as parameters to your Cloud Function or Job.

    See more

    Declaration

    Swift

    public protocol ParseCloud : ParseType, CustomDebugStringConvertible, Decodable
  • Objects that conform to the ParseConfig protocol are able to access the Config on the Parse Server. When conforming to ParseConfig, any properties added can be retrieved by the client or updated on the server.

    See more

    Declaration

    Swift

    public protocol ParseConfig : ParseType, CustomDebugStringConvertible, Decodable